Top VPS Hosting Provider

Welcome to the myhosting.com Forums.
+ Reply to Thread
Results 1 to 5 of 5

Thread: php.ini

  1. #1
    juc1 is offline Gold Member
    Join Date
    Dec 2010
    Posts
    50

    Default php.ini

    Hi all,

    Can anyone please tell me why my Debian 6 VPS has three files for php.ini =

    /etc/php5/cgi/php.ini

    /etc/php5/apache2/php.ini

    /etc/php5/cli/php.ini



    Thanks

  2. #2
    suwunk is offline Super Moderator
    Join Date
    Aug 2010
    Posts
    1,096

    Default

    Depends how you're using PHP...
    -When you're using it from the command line (CLI), it uses the ini from the CLI folder (/etc/php5/cli/php.ini )
    -When it's called from the web server (as it is when you're using a browser), it uses the one in the apache2 folder (/etc/php5/apache2/php.ini)
    -When you're using it from the CGI, it uses the ini from the CGI folder (/etc/php5/cgi/php.ini)

    Cheers

  3. #3
    juc1 is offline Gold Member
    Join Date
    Dec 2010
    Posts
    50

    Default

    Quote Originally Posted by suwunk View Post
    Depends how you're using PHP...
    -When you're using it from the command line (CLI), it uses the ini from the CLI folder (/etc/php5/cli/php.ini )
    -When it's called from the web server (as it is when you're using a browser), it uses the one in the apache2 folder (/etc/php5/apache2/php.ini)
    -When you're using it from the CGI, it uses the ini from the CGI folder (/etc/php5/cgi/php.ini)

    Cheers
    Ok thanks so these files can have different values? Anyway to change values (eg post_max_size and upload_max_filesize) for my websites would I edit /etc/php5/apache2/php.ini or /etc/php5/cgi as mentioned by my phpinfo.php (screenshot attached)?

    Thanks

    phpini.jpg

  4. #4
    suwunk is offline Super Moderator
    Join Date
    Aug 2010
    Posts
    1,096

    Default

    Look for the following entry:
    Loaded Configuration File /var/www/vhosts/example.com/etc/php.ini
    that is basically where your global php.ini file resides on your system

  5. #5
    mithcd is offline Official Member
    Join Date
    Sep 2012
    Posts
    15

    Default

    I've been wondering this pretty much myself. This is specially in linux devices. I don't think they are symbolic links either. So if we make some changes, should the global .ini takes care oto all of them?


 

Similar Threads

  1. php.ini
    By juc1 in forum Virtual Server
    Replies: 1
    Last Post: 2010-12-29, 01:49 PM
  2. Php?
    By WrigleyF in forum Programming
    Replies: 0
    Last Post: 2010-06-10, 11:09 AM
  3. PHP tips
    By Coltrane in forum Beginners
    Replies: 0
    Last Post: 2010-05-17, 06:16 PM
  4. PHP
    By teachu in forum Programming
    Replies: 15
    Last Post: 2009-04-30, 09:30 AM
  5. DAFAUTH.INI / handling of login error
    By GregMillerPhotography in forum Troubleshooting
    Replies: 3
    Last Post: 2008-08-08, 10:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts