Cannot activate shell_exec - " Warning: shell_exec() has been disabled for security reasons "

  • Hi!


    Versions etc.:
    Operating system: Ubuntu Server 14.04 LTS
    I-mscp: 1.2.11
    Apache: 2.4.7
    PHP: 5.5.9-1ubuntu14.4 (CLI)
    Zend-engine: 2.5.0
    Zend OPache: 7.0.3
    Nginx: 1.4.6


    I'm hosting a cloud-service which uses I-mscp and Owncloud. A friend of mine has developed an PHP-file that, through a form on my website, automatically creates users in Ownclouds database.


    This configration worked flawlessly in his test-configuration of i-mscp, however since we transferred the files onto my server upon completion of the PHP-file, it does not work anymore.


    When i try to register a new user, i get the error: Warning: shell_exec() has been disabled for security reasons in /var/www/virtual/jonkopingteleteknik.se/htdocs/wp-content/plugins/ithemes-exchange/lib/pages/callback.php on line 26


    This error points towards the PHP-file created by my friend. However it works on his test-setup on his own server so it must be an error in my configuration. We have together spent the weekend searching for errors, changed all the php.ini files, added " safe_mode off" to them all and deleted all of the "disable_functions" that contain shell_exec but it still does not work.


    During our search we saw that both apache and nginx is installed, when i went through the initial setup of i-mscp i choose to only install apache. We changed those files, linked to both Apache and Nginx and have restarted both the servers, nothing will work.


    Does anyone have an idea of where the error is located? ;(


    Best regards


    Patrik


    Edit: I missed to say that i have activated shell_exec in the controlpanelen of I-mscp, that was the first thing i did before we started looking through the php.ini-fles.

  • @dammvippa


    First of all: nginx is used for the panel frontEnd only, not for customer sites. You must not modify any file that belongs to nginx.


    For your problem, we need first know the i-MSCP httpd server implementation that you use.


    Please, give us the output of the following command:

    Code
    1. cat /etc/imscp/imscp.conf |grep HTTPD_SERVER

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Roger that!


    The output of that command:


    root@vargen:~# cat /etc/imscp/imscp.conf |grep HTTPD_SERVER
    HTTPD_SERVER = apache_php_fpm


    Best regards


    Patrik


    Edit:


    I will try to change the Nginx-files back to original again.

  • Re;


    Which PHP file do you have edited exactly and please, what is the output of the following command:


    Code
    1. # cat /etc/imscp/php-fpm/phpfpm.data |grep PHP_FPM_POOLS_LEVEL


    Also when you say:


    Quote

    Edit: I missed to say that i have activated shell_exec in the controlpanelen of I-mscp, that was the first thing i did before we started looking through the php.ini-fles.


    Can you clarify? How you processed exactly? I want the details ;)


    When using PHP-FPM, you must edit the related pool configuration file which are located under /etc/php5/fpm/pool.d/ and once done, restart the PHP-FPM instance (service php5-fpm restart). But normally, you can do all that through the panel (PHP Editor).

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Hi again! ;)


    Let's start with the output:


    root@vargen:~# cat /etc/imscp/php-fpm/phpfpm.data |grep PHP_FPM_POOLS_LEVEL
    PHP_FPM_POOLS_LEVEL = per_user



    Clarification:


    I have enabled the exec and so on in the panel, will attach a printscreen. They where green-ish and when i clicked on them they became black, which i think stand for =enable. There standard-status was green (disable?)


    What do i change in that file? I'm not the best at PHP from the beginning so this is almost out of my knowledgde-base already. Can you describe what to do, very basic? haha! :blush:


    Thank you for your time!


    Patrik


    edit:


    These are the PHP-file which we have edited, deleted everything that was on the line after "disable_functions" that contained exec and so on. We also put in "safe_mode off" to every file.


    /usr/local/src/imscp-1.2.11/configs/debian/fcgi/parts/php5/php.ini
    /usr/local/src/imscp-1.2.11/configs/debian/nginx/parts/master/php5/php.ini
    /etc/imscp/php-fpm/working/php.ini
    /etc/imscp/fcgi/parts/php5/php.ini
    /etc/imscp/nginx/parts/master/php5/php.ini
    /etc/php5/fpm/php.ini
    /etc/php5/cli/php.ini
    /etc/php5/cgi/php.ini
    /home/vargen/imscp-1.2.11/configs/debian/fcgi/parts/php5/php.ini
    /home/vargen/imscp-1.2.11/configs/debian/nginx/parts/master/php5/php.ini
    /var/www/fcgi/master/php5/php.ini


    I have restored the nginx-files, removed the "safe_mode off". I cannot remeber what the lines after "disable_funtions" were so i cannot restore them :(

    Files

    • Panel.jpg

      (163.22 kB, downloaded 13 times, last: )
  • @dammvippa


    Ok ;) The settings you have edited only operate for newly created accounts (default values).


    In order, you must:


    1. As administrator


    Edit the reseller and enable PHP editor and set correct parameters.


    2. As reseller


    Edit your customer domain and enable PHP editor and set correct parameters.


    3. As customer


    Edit PHP settings according your needs.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206


  • OUCH ;) You edited all those files for nothing... Next time, you should ask us before acting. Doing things by closing your eyes is a bad thing for us, you and your server. Now the best is to rerun the i-MSCP installer which will regenerate all the files for you. Then once done, you must do as I've say in my previouos post to edit your customer PHP settings.



    BTW: When using PHP-FPM, there is only one global php.ini. Customer PHP settings are put in specific file called pool configuration file. These file are located in the /etc/php5/fpm/pool.d/ directory. You should consider to learn more about PHP before acting.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Thanks man, that worked of the problem with disabled shell_exec. However an new error ocurred! :P haha!


    Now it ony says:


    bool(false) and a totaly white page!


    What is wrong now?

  • OUCH ;) You edited all those files for nothing... Next time, you should ask us before acting. Doing things by closing your eyes is a bad thing for us, you and your server. Now the best is to rerun the i-MSCP installer which will regenerate all the files for you. Then once done, you must do as I've say in my previouos post to edit your customer PHP settings.



    BTW: When using PHP-FPM, there is only one global php.ini. Customer PHP settings are put in specific file called pool configuration file. These file are located in the /etc/php5/fpm/pool.d/ directory. You should consider to learn more about PHP before acting.

    I'm sorry! :blush::blush::blush:

  • @dammvippa


    I cannot say ;) I forgot my crystal ball.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206