Using my own php.ini

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beary
    New Member
    • Nov 2006
    • 170

    Using my own php.ini

    Hello all,

    I read up on the ability to place my own php.ini file in my web folder's directory, which is supposed to override the standard php.ini file. But it still seems to be using the standard one. Is there any setting I'm supposed to change somewhere for php to use my ini file?

    Thanks
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Run the phpinfo script
    [CODE=php]<?php phpinfo(); ?>[/CODE] and check near the top of the first table there which php.ini is being used by your php engine. You'd then need to override the file in that location with yours.
    P.S Don't forget to back up the old one first before overriding it.

    Comment

    • beary
      New Member
      • Nov 2006
      • 170

      #3
      Originally posted by r035198x
      Run the phpinfo script
      [CODE=php]<?php phpinfo(); ?>[/CODE] and check near the top of the first table there which php.ini is being used by your php engine. You'd then need to override the file in that location with yours.
      P.S Don't forget to back up the old one first before overriding it.
      Hey there r035198x,

      I've done that already and it's definitely using the standard one. The thing is, apparently it's possible to keep the standard one in the normal place, but put a different one in your own web directory.

      So, the main one is in /etc/php5/apache2 but my website is in /var/www/html/mysite. Obviously for security I can't get into /etc/php5/apache2 anyway, so I need to place my php.ini file into var/www/html/mysite, which I can do (and have done).

      But my question is how do I then tell php to use the php.ini file in var/www/html/mysite, whenever pages in the mysite directory are being loaded?

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Did you restart the web server?

        Comment

        • Markus
          Recognized Expert Expert
          • Jun 2007
          • 6092

          #5
          I think it would be rather stupid if you could just upload your own php.ini to a website and have it override the original one.

          Unless you have access to the orignal one, I don't think you can change it.

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            Originally posted by markusn00b
            I think it would be rather stupid if you could just upload your own php.ini to a website and have it override the original one.

            Unless you have access to the orignal one, I don't think you can change it.
            See the documentation for it here. You can even put it in the directory containing your script.

            Comment

            Working...