The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to change EasyAPache PATH environment vairable for PHP exec()?

Discussion in 'EasyApache' started by vacek37, Dec 8, 2012.

  1. vacek37

    vacek37 Registered

    Joined:
    Dec 8, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,
    I am running EasyApache 3.16.5 on CentOS 6.3 with WHM 11.34.0, dedicated server.

    I found that when I run EasyApache it defines
    PATH=/bin:/usr/bin
    for executing shell commands with PHP exec() and similar PHP functions. I also need to run executables in PHP app via exec() from the other folders, e.g /usr/local/bin

    From here
    I understood that I have to create a new file:
    /var/cpanel/easy/apache/rawenv/.append_PATH
    and add there the desired PATH extension. So I added the below line to this file:
    /usr/local/jdk/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin

    Next, I re-built EasyApache in WHM and restarted the httpd daemon, but I am still getting the same
    /bin:/usr/bin
    PATH in my PHP app.

    What I am doing wrong?
     
  2. seogow

    seogow Registered

    Joined:
    Apr 10, 2014
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi, have you got a solution for this? I have exactly the same problem... Thanks!
     
  3. seogow

    seogow Registered

    Joined:
    Apr 10, 2014
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    The solution is actually here:
    /http://serverfault.com/questions/588218/change-apache-php-path-environment-variable-on-centos-with-cpanel/588364?noredirect=1#comment692849_588364
    linux - Change apache (PHP) $PATH environment variable on CentOS with cPanel - Server Fault
     
Loading...

Share This Page