Page 1 of 2

PHP Extension

Posted: Wed 8. Feb 2023, 19:59
by veszvs
Hello everybody, I'm new to the forum.

I've been using KeyHelp for weeks now, great panel, really nice.

But I have problems.
I need to enable and disable extensions of PHP versions.
Many of my scripts don't work properly.

Thank you.

Re: PHP Extension

Posted: Thu 9. Feb 2023, 08:10
by christian.john
Hallo and welcome,

perhaps you can tell us something about your scripts or even tell us something about the extensions you need.

Have you seen the configuration part where you can activate or disable php-functions?

Chris

Re: PHP Extension

Posted: Thu 9. Feb 2023, 09:50
by Florian
Hello,

PHP module for the system PHP version can be installed easily by apt

PHP modules for the additional Keyhelp PHP version have to be compiled or installed via PECL.

e.g. compiling of redis extension for PHP 7.4:

Code: Select all

wget https://pecl.php.net/get/redis-5.1.1.tgz

tar xzf redis-5.1.1.tgz

cd redis-5.1.1/

/opt/keyhelp/php/7.4/bin/phpize (install autoconf if necessary)

./configure --with-php-config=/opt/keyhelp/php/7.4/bin/php-config
make
make install

echo "extension=redis.so" > /opt/keyhelp/php/7.4/etc/conf.d/redis.ini

/etc/init.d/keyhelp-php74-fpm restart

Re: PHP Extension

Posted: Thu 9. Feb 2023, 14:58
by veszvs
christian.john wrote: ↑Thu 9. Feb 2023, 08:10 Hallo and welcome,

perhaps you can tell us something about your scripts or even tell us something about the extensions you need.

Have you seen the configuration part where you can activate or disable php-functions?

Chris
Honestly, I still don't understand how it works.
I'm used to cpanel, that I just select what I need and done.

Re: PHP Extension

Posted: Thu 9. Feb 2023, 15:02
by veszvs
Florian wrote: ↑Thu 9. Feb 2023, 09:50 Hello,

PHP module for the system PHP version can be installed easily by apt

PHP modules for the additional Keyhelp PHP version have to be compiled or installed via PECL.

e.g. compiling of redis extension for PHP 7.4:

Code: Select all

wget https://pecl.php.net/get/redis-5.1.1.tgz

tar xzf redis-5.1.1.tgz

cd redis-5.1.1/

/opt/keyhelp/php/7.4/bin/phpize (install autoconf if necessary)

./configure --with-php-config=/opt/keyhelp/php/7.4/bin/php-config
make
make install

echo "extension=redis.so" > /opt/keyhelp/php/7.4/etc/conf.d/redis.ini

/etc/init.d/keyhelp-php74-fpm restart
Honestly, I did not understand what you made me do ...
but it didn't work for me.

Re: PHP Extension

Posted: Thu 9. Feb 2023, 15:05
by veszvs
It would be nice, like on many other panels, to be able to manually select the php extensions for each php version.
Unfortunately, not all of them are very practical.

So it would be just ideal... perfect even for less experienced and practical users.

Image



I do not know what to do...
Unfortunately, there isn't much detailed information on the keyhelp site, and there aren't any step-by-step guides online.
😞

Re: PHP Extension

Posted: Thu 9. Feb 2023, 15:19
by Tobi
I would guess youΒ΄re probably fine with one of the additional PHP interpreters.

Only the standard OS PHP version needs some manual installations.

In the additional PHP interpreters 99,9% of common PHP modules & extensions are already included.


So far we do not really know which extentions you are missing...

Re: PHP Extension

Posted: Thu 9. Feb 2023, 15:38
by veszvs
Tobi wrote: ↑Thu 9. Feb 2023, 15:19 I would guess youΒ΄re probably fine with one of the additional PHP interpreters.

Only the standard OS PHP version needs some manual installations.

In the additional PHP interpreters 99,9% of common PHP modules & extensions are already included.


So far we do not really know which extentions you are missing...

Honestly, I don't even know what extension this script needs.
But I know that on cpanel, cwp and hestiacp, it can be seen correctly, while here I can't do it, I've been working on it for 10 days, I had completed the migration when I realized this very serious problem that prevents some of my apps from working.

The script must read a json file.
The script must encrypt the json file.
The script has to write the json file.

In the error log, it gives a small error, but this error also gives me on the other panels, I don't think this affects the functioning.


Could it be that some extension is missing for json to work properly?

Re: PHP Extension

Posted: Thu 9. Feb 2023, 15:45
by 24unix
veszvs wrote: ↑Thu 9. Feb 2023, 15:38 In the error log, it gives a small error, but this error also gives me on the other panels, I don't think this affects the functioning.


Could it be that some extension is missing for json to work properly?
Maybe, if you just post the error here.

Programmers have reason to give them names, and to print them out.

Re: PHP Extension

Posted: Thu 9. Feb 2023, 15:48
by veszvs
24unix wrote: ↑Thu 9. Feb 2023, 15:45
veszvs wrote: ↑Thu 9. Feb 2023, 15:38 In the error log, it gives a small error, but this error also gives me on the other panels, I don't think this affects the functioning.


Could it be that some extension is missing for json to work properly?
Maybe, if you just post the error here.

Programmers have reason to give them names, and to print them out.

This error:

Code: Select all

AH01071: Got error 'PHP message: PHP Notice: Undefined index: password in /home/users/USER/www/folder/index.php on line 7'
index.php
line 7-8

Code: Select all

$plaintext_password = $_POST['password'];  
  $hash = password_hash($plaintext_password, 
          PASSWORD_DEFAULT);
It looks like an error that can't recover the password.
But when I log in with my details, it works, I can log in without problems.

So as I said it's not a problem of this little error.

Re: PHP Extension

Posted: Thu 9. Feb 2023, 15:58
by 24unix
veszvs wrote: ↑Thu 9. Feb 2023, 15:48
24unix wrote: ↑Thu 9. Feb 2023, 15:45
veszvs wrote: ↑Thu 9. Feb 2023, 15:38 In the error log, it gives a small error, but this error also gives me on the other panels, I don't think this affects the functioning.


Could it be that some extension is missing for json to work properly?
Maybe, if you just post the error here.

Programmers have reason to give them names, and to print them out.

This error:

Code: Select all

AH01071: Got error 'PHP message: PHP Notice: Undefined index: password in /home/users/USER/www/folder/index.php on line 7'
That is a notification, not an error.
But, yes, that is the reason that your script won't work.
veszvs wrote: ↑Thu 9. Feb 2023, 15:48
index.php
line 7-8

Code: Select all

$plaintext_password = $_POST['password'];  
  $hash = password_hash($plaintext_password, 
          PASSWORD_DEFAULT);
It looks like an error that can't recover the password.
But when I log in with my details, it works, I can log in without problems.

So as I said it's not a problem of this little error.
The script expects $_POST['password'] to have a value.
It neither tests if it's empty, nor does it make any input validation.

That is very 90ies like …

Is it a script from the internet? Can we check the code?

Re: PHP Extension

Posted: Thu 9. Feb 2023, 16:03
by veszvs
24unix wrote: ↑Thu 9. Feb 2023, 15:58
veszvs wrote: ↑Thu 9. Feb 2023, 15:48
24unix wrote: ↑Thu 9. Feb 2023, 15:45
Maybe, if you just post the error here.

Programmers have reason to give them names, and to print them out.

This error:

Code: Select all

AH01071: Got error 'PHP message: PHP Notice: Undefined index: password in /home/users/USER/www/folder/index.php on line 7'
That is a notification, not an error.
But, yes, that is the reason that your script won't work.
veszvs wrote: ↑Thu 9. Feb 2023, 15:48
index.php
line 7-8

Code: Select all

$plaintext_password = $_POST['password'];  
  $hash = password_hash($plaintext_password, 
          PASSWORD_DEFAULT);
It looks like an error that can't recover the password.
But when I log in with my details, it works, I can log in without problems.

So as I said it's not a problem of this little error.
The script expects $_POST['password'] to have a value.
It neither tests if it's empty, nor does it make any input validation.

That is very 90ies like …

Is it a script from the internet? Can we check the code?
Unfortunately it is not a script that I can show in full.
I am sorry.
This error appears when I login to the index.php page.
But I don't care about that, it's the after that there are problems.
It's when the script has to fetch the contents of the json file, which are encoded and it has to decode them and save them encoded.
That's where the problem arises.
It does not work...

Code: Select all

$prepair = file_get_contents("json/file.json");
$json_arr = json_decode($prepair, true);

array_splice($json_arr['file_info'], $delete, 1);

$newJsonData = json_encode($json_arr, JSON_PRETTY_PRINT);

file_put_contents("./json/file.json",$newJsonData);
header('Location: info.php');
As shown above... this seems to be the problem, this is where keyhelp fails.

Re: PHP Extension

Posted: Thu 9. Feb 2023, 16:08
by 24unix
veszvs wrote: ↑Thu 9. Feb 2023, 16:03 It does not work...
It does not work is no error message.

What's in error.log?

Re: PHP Extension

Posted: Thu 9. Feb 2023, 16:10
by veszvs
24unix wrote: ↑Thu 9. Feb 2023, 16:08
veszvs wrote: ↑Thu 9. Feb 2023, 16:03 It does not work...
It does not work is no error message.

What's in error.log?
There are no errors in the error.log

In my opinion, It's just a shortage of php extensions.

Re: PHP Extension

Posted: Thu 9. Feb 2023, 16:16
by 24unix
Missing extension are noted in the error log.