Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - JoeDer

Pages: [1] 2
1
PHP / Re: PHP disable_functions for separated vhost
« on: January 27, 2021, 03:19:36 PM »
I reinstalled everything from scratch and the only way to add disable functions for 1 user is the below quoted steps with PHP-FPM.

I checked again the PHP configuration settings via phpinfo() function and I saw again that the path of PHP Loaded Configuration File is /opt/alt/php-fpm74/usr/php/php.ini and not /home/user/public_html/php.ini that means the extra new disable_functions record can't be read from the user's custom php.ini file.

I don't know what else to do to have the path of PHP Loaded Configuration File on user home folder (/home/user/public_html/) that the custom php.ini file exist.

1. CWP Admin, Webserver Settings, Webservers Conf Editor, PHP-FPM
2. php-fpm74 tab
3. Edit a user account conf
4. Add to the bottom: php_admin_value[disable_functions] = shell, shell_exec, system
5. Restart/Reload Apache and PHP-FPM

2
PHP / Re: PHP disable_functions for separated vhost
« on: January 26, 2021, 03:27:51 PM »
disable_functions   shell, shell_exec

(Note the space after the comma - gotta be worth checking? )
See my update above..  ;)

I already tried both, with space after comma and without space after comma with no luck... Time to go and install everything from scratch. Thanks again :)

3
PHP / Re: PHP disable_functions for separated vhost
« on: January 26, 2021, 03:21:25 PM »
OK, I will rebuild my server with a clean CentOS 7 and a fresh CWPpro installation without any modifications and I will try only to go with your steps and I will be back with the new results. Thanks for your help and time :)

4
PHP / Re: PHP disable_functions for separated vhost
« on: January 26, 2021, 03:04:53 PM »
Yes

5
PHP / Re: PHP disable_functions for separated vhost
« on: January 26, 2021, 02:53:32 PM »
No, I'm running a CWPpro version with PHP-CGI and installed PHP versions from PHP Selector v2.

6
PHP / Re: PHP disable_functions for separated vhost
« on: January 26, 2021, 02:38:03 PM »
I'm currently using PHP-CGI and I see only PHP-FPM.

7
PHP / Re: PHP disable_functions for separated vhost
« on: January 26, 2021, 02:21:09 PM »
Steps/(Spoon-feeding).
1. Admin CWP, list Accounts, open panel for user (wait 20secs. or so)..
2. User CWP, PHP Selector
3. Select Domain, file browser should highlight/display public_html, by default.
4. Select PHP version alongside the above (PHP 7.4 Selector CGI), Apply
5. CWP Settings, Edit PHP.ini
6. Add a new Record, disable_functions, "shell_exec, exec, system" (no quotes), Add, Update changes
7. File Management, File Manager, create a phpinfo() PHP file in /home/username/public_html
8. Admin CWP (restart Apache)
9. Internet browser: website/phpinfo.php

Result.
PHP Version 7.4.11
Server API    CGI/FastCGI
Virtual Directory Support    disabled
Configuration File (php.ini) Path    /opt/alt/php74/usr/php
Loaded Configuration File    /home/webp/public_html/php.ini
Scan this dir for additional .ini files    /opt/alt/php74/usr/php/php.d
Additional .ini files parsed    /opt/alt/php74/usr/php/php.d/imagick.ini, /opt/alt/php74/usr/php/php.d/ioncube.ini, /opt/alt/php74/usr/php/php.d/mcrypt.ini, /opt/alt/php74/usr/php/php.d/redis.ini

disable_functions   exec, shell_exec, system

Notes:
You can't mix CGI & FPM within the same domain.
Selecting PHP-FPM, the editor changes .user.ini
Selecting PHP-CGI the editor changes php.ini and allows per directory settings.

Perfect, with these steps at my phpinfo() I can see that the paths loaded from /opt/alt/php74/usr/php/... but the Loaded Configuration File hasn't changed to  /home/my_domain/public_html/php.ini

8
PHP / Re: PHP disable_functions for separated vhost
« on: January 26, 2021, 02:02:37 PM »
Thanks but I haven't any problem even if I break them all. I'm new to CWP and I'm working on a test server to learn more about CWP.

So, the point (I think) is how to change the php.ini configuration path to read php.ini or .user.ini from the user's root folder when I have PHP Selector v2 or PHP-FPM Selector activated with 2< PHP versions.


9
PHP / Re: PHP disable_functions for separated vhost
« on: January 26, 2021, 01:06:59 PM »
I do not understand, what should I do with munin in relation to my issue?

10
PHP / Re: PHP disable_functions for separated vhost
« on: January 26, 2021, 12:25:54 PM »
Where is the tutorial? Thare isn't any link. I switched to PHP-FPM from PHP-CGI and still can't figure how can work php.ini or .user.ini for any account separately.

11
PHP / Re: PHP disable_functions for separated vhost
« on: January 25, 2021, 02:30:51 PM »
OK, thank you! I think if I can change the path to php.ini to load from users' root folder it will work.

12
PHP / Re: PHP disable_functions for separated vhost
« on: January 25, 2021, 02:13:03 PM »
How can I change the Loaded Configuration File to loaded at the domain's root folder?

I had also un-comment the below value because I have the .user.ini file with the same values as php.ini but seems to not work.


13
PHP / Re: PHP disable_functions for separated vhost
« on: January 25, 2021, 02:01:30 PM »
Yes it exist in my public_html
php.ini and .user.ini with the same values.

14
PHP / Re: PHP disable_functions for separated vhost
« on: January 25, 2021, 01:36:56 PM »

15
PHP / Re: PHP disable_functions for separated vhost
« on: January 25, 2021, 01:33:21 PM »
There is no value at disable_functions in my public_html phpinfo file and that is the weird thing


Pages: [1] 2