Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Member testlog_4u's Avatar
    Join Date
    Sep 2007
    Posts
    42

    Default Local php.ini not working

    Hello,

    /home/username/public_html/php.ini not taking any effect for any user in the server. Server running wuth PHPsuexec enabled. Where I would have to check?

    Apache/2.2.9
    PHP 5.2.6

    Thanks

  2. #2
    Member
    Join Date
    Sep 2004
    Posts
    6

    Default

    Hi,

    PHPSuExec was removed from the newest EasyApache, have you updated your cPanel so you have the latest files? In place of PHPSuExec, you should use suPHP, with this you can specify a custom php.ini file. There is a nice writeup on how to do this here: http://www.watters.ws/wiki/index.php...ile_with_suPHP

  3. #3
    Member testlog_4u's Avatar
    Join Date
    Sep 2007
    Posts
    42

    Default

    Hello,

    Thank you for this. After making codes in .htaccess and php.ini files in the particular user I am getting 500 Internal Server Error. cPanel is updated.

    Thank you,

  4. #4
    Member
    Join Date
    Aug 2002
    Posts
    1,120

    Default

    Have a read through the thread at:

    http://forums.cpanel.net/showthread.php?t=76084

    this deals specifically with register_globals, but the same concept applies here.

  5. #5
    Member testlog_4u's Avatar
    Join Date
    Sep 2007
    Posts
    42

    Default

    Hey..

    Thank you for this .. checking the thread ..

    Quote Originally Posted by sparek-3 View Post
    Have a read through the thread at:

    http://forums.cpanel.net/showthread.php?t=76084

    this deals specifically with register_globals, but the same concept applies here.

  6. #6
    Member testlog_4u's Avatar
    Join Date
    Sep 2007
    Posts
    42

    Default Hello sparek-3

    Hello,

    I have gone through that thread and just need to set Include I think. I have also did as per your post in the same thread but still no luck. Can you please help to where I set Include in httpd.conf and what I need to add in it. I have created an include file manually ../usr/local/apache/conf/userdata/username/addon.domain.com/test.conf

    This is VirtualHost entry in httpd.conf I have

    <VirtualHost server IP:80>
    ServerName addon.domain.com
    ServerAlias addondomainname www.addondomainname
    ServerAlias www.addon.domain.com
    DocumentRoot /home/username/public_html/addondomain.com
    ServerAdmin webmaster@addon.domain.com
    ## User username # Needed for Cpanel::ApacheConf
    UseCanonicalName off
    <IfModule mod_suphp.c>
    suPHP_UserGroup username username
    </IfModule>
    <IfModule concurrent_php.c>
    php4_admin_value open_basedir "/home/username:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
    php5_admin_value open_basedir "/home/username:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    <IfModule !concurrent_php.c>
    <IfModule mod_php4.c>
    php_admin_value open_basedir "/home/username:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
    </IfModule>
    <IfModule mod_php5.c>
    php_admin_value open_basedir "/home/username:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    <IfModule sapi_apache2.c>
    php_admin_value open_basedir "/home/username:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
    </IfModule>
    </IfModule>
    <IfModule !mod_disable_suexec.c>
    SuexecUserGroup username username
    </IfModule>

    CustomLog /usr/local/apache/domlogs/addon.domain.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    CustomLog /usr/local/apache/domlogs/addon.domain.com combined
    ScriptAlias /cgi-bin/ /home/username/public_html/addon.domain.com/cgi-bin/
    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/username/addon.domain.com/*.conf"
    </VirtualHost>

    Thanks in advance,

  7. #7
    Member testlog_4u's Avatar
    Join Date
    Sep 2007
    Posts
    42

    Default

    I tried with this also as per your post ...at here

    Quote Originally Posted by sparek-3 View Post
    If you are using suphp the easiest solution is to add this line in the VirtualHost container for that Virtualhost:

    suPHP_ConfigPath /home/user/php

    Then create a /home/user/php directory and copy your server-wide php.ini file to that directory. Edit the /home/user/php/php.ini and enable register_globals. Then restart Apache.

    If you are using Apache2 or EA3, you will want to use the include system so you will want to create a folder:

    mkdir -p /usr/local/apache/conf/userdata/std/2/user/domain.com

    Then create a suphp.conf file in that directory (/usr/local/apache/conf/userdata/std/2/user/domain.com/suphp.conf).

    Add the lines:

    <IfModule mod_suphp.c>
    suPHP_ConfigPath /home/user/php
    </IfModule>


    Run /scripts/ensure_vhost_includes --user=user

    This will cause suphp to read the php.ini file that is in /home/user/php instead of the server-wide php.ini file.

    Of course, the absolute best action is to figure out why the script needs register_globals in the first place. Is the script the latest version? Do the developers realize that register_globals is going to be deprecated in PHP6? Any script that requires register_globals in order to work really falls into one of two categories. Either the project that created the script is dead and the script is no longer being maintained (therefore a security risk). Or the script was developed by someone who is not an expert PHP programmer and how much trust do you really want to put in such a PHP script? (They may be a beginner PHP programmer, and beginners do make mistakes there's nothing wrong with that, but they need to be educated about their mistakes).

  8. #8
    Member
    Join Date
    Aug 2002
    Posts
    1,120

    Default

    What is the contents of /usr/local/apache/conf/userdata/username/addon.domain.com/test.conf?

    Did you run:

    /scripts/ensure_vhost_includes --user=username

    as well?

  9. #9
    Member testlog_4u's Avatar
    Join Date
    Sep 2007
    Posts
    42

    Default

    Contents of /usr/local/apache/conf/userdata/username/addon.domain.com/test.conf :

    <IfModule mod_suphp.c>
    suPHP_ConfigPath /home/username/php
    </IfModule>

    Yes I did run /scripts/ensure_vhost_includes --user=username and there was no output for this.

  10. #10
    Member
    Join Date
    Aug 2002
    Posts
    1,120

    Default

    Oh, I see the problem.

    The filename/path has to be:

    /usr/local/apache/conf/userdata/std/2/username/addon.domain.com/test.conf

    you're missing some of that

  11. #11
    Member testlog_4u's Avatar
    Join Date
    Sep 2007
    Posts
    42

    Default

    Sorry it didn't work, I think I have to recompile apache with mod_suphp

  12. #12
    Member
    Join Date
    Aug 2007
    Posts
    6

    Default

    Try out this if its php5.

    mv /usr/local/cpanel/cgi-sys/php5 /usr/local/cpanel/cgi-sys/php5.bin
    create a file /usr/local/cpanel/cgi-sys/php5 and add the following:

    #!/bin/bash

    # This will fake the name & path and hide the /usr/local/cpanel/cgi-sys/php5 path!
    export SCRIPT_NAME=$REQUEST_URI
    export SCRIPT_FILENAME=$PATH_TRANSLATED
    export PWD=$DOCUMENT_ROOT

    if [ -f "$DOCUMENT_ROOT/php.ini" ]; then
    exec /usr/local/cpanel/cgi-sys/php5.bin -c $DOCUMENT_ROOT
    else
    exec /usr/local/cpanel/cgi-sys/php5.bin
    fi

    Change the permission:
    chown root:wheel /usr/local/cpanel/cgi-sys/php5*;
    chmod 755 /usr/local/cpanel/cgi-sys/php5*;

    It worked for me

Similar Threads & Tags
Similar threads

  1. PHP: Error parsing /usr/local/lib/php.ini on line 782
    By BerbBrown in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 04-11-2011, 05:07 PM
  2. PHP: Error parsing /usr/local/lib/php.ini on line 1136
    By desiguru in forum New User Questions
    Replies: 1
    Last Post: 12-08-2009, 07:11 PM
  3. Local php.ini files stopped working after upgrade
    By frisbees in forum cPanel and WHM Discussions
    Replies: 16
    Last Post: 10-17-2008, 09:46 AM
  4. Local copy of php.ini not working
    By monte in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-17-2005, 07:20 AM
  5. Disabling local php.ini while php still runs in SUExec mode
    By gizmoh in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-10-2005, 11:34 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube