SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot spybreak's Avatar
    Join Date
    Apr 2003
    Location
    Germany
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php.ini per-directory basis not working

    Hi!

    For some reason putting a custom php.ini file in my webroot doesn't work. It should work though:
    ; PHP looks for php.ini in the current working directory, in the path
    ; designated by the environment variable PHPRC, and in the path that
    ; was defined in compile time (in that order).
    ; Under Windows, the compile-time path is the Windows directory.
    Anyway, PHP always loads the c:/WINNT/php.ini file even though I have a valid php.ini in my current working directory.

    Enviroment: PHP-CGI, Apache2, Windows 2000


    Does anyone know a solution to this problem?

  2. #2
    Umm. PHP Guru....Naaaah jaswinder_rana's Avatar
    Join Date
    Jul 2004
    Location
    canada
    Posts
    3,193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP will only work with one PHP.ini and on windows it is generally located at c:\windows(if not changed the default)
    so if you create a PHP.ini in c:\windows\system it won't work

    Now if you want to change some values you can do it via .htaccess (not available with IIS i think). i don't know the exact syntax but i am sure somebody will tell you.

    second you can do it with PHP function like
    ini_set('include_path','your news include path');

    i onlyknow these 2 ways. But, as far as PHP.ini is concerned only one PHP.ini would be in effect at all times(unless i don't know a method if this can be done. in that case disregard this post)

  3. #3
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are now a number of WAMPs and LAMPs that allow you to share both PHP4.x and PHP5.x on the same box with their own independent PHP INI files, but I've not idea how it's done, but it is possible

    Maybe doing a search on google for this will help you?

    EDIT:

    If you only have the one PHP version, why'd you need more than one set of configurations?

  4. #4
    SitePoint Zealot spybreak's Avatar
    Join Date
    Apr 2003
    Location
    Germany
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had PHP installed as a module before, and I always used to change the configuration using .htaccess, for example auto_prepend_file. But since my host has PHP installed as CGI (and online, I can change the configuration using custom php.ini files), I wanted to have it the same on my development system so I don't have the fuss of changing the configuration everytime I upload a website..

  5. #5
    Umm. PHP Guru....Naaaah jaswinder_rana's Avatar
    Join Date
    Jul 2004
    Location
    canada
    Posts
    3,193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so, you mean if PHP is installed as cgi we can have our own PHP.ini.
    can you explain a bit more how do we use it and how do we specify to server which PHP.ini to use??

  6. #6
    SitePoint Zealot spybreak's Avatar
    Join Date
    Apr 2003
    Location
    Germany
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Some hosts have it that way. And it says so too in php.ini (see the part I quoted above). So it should work, but it's not working for me, don't know why.


Bookmarks

Posting Permissions

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