php.ini location question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • furry

    php.ini location question

    I'm trying to set the PHP include path for a PHP class on my web host, but I
    don't have access to the root php.ini.

    My host allows me to have my own php.ini which applies to each directory it
    appears in but it seems I need to have a php.ini in each and every directory
    I want my include path to apply in.

    I would rather avoid having a php.ini in each directory, since it's a class
    I use all over my site (phpMailer - excellent multipart email class).

    Is there any way to make my php.ini in my webserver root apply to all
    sub-directories, or another way to achieve this (btw - I can't use
    ..htaccess) ?

    Thanks in advance.


  • Justin Koivisto

    #2
    Re: php.ini location question

    furry wrote:[color=blue]
    > I'm trying to set the PHP include path for a PHP class on my web host, but I
    > don't have access to the root php.ini.
    >
    > My host allows me to have my own php.ini which applies to each directory it
    > appears in but it seems I need to have a php.ini in each and every directory
    > I want my include path to apply in.
    >
    > I would rather avoid having a php.ini in each directory, since it's a class
    > I use all over my site (phpMailer - excellent multipart email class).
    >
    > Is there any way to make my php.ini in my webserver root apply to all
    > sub-directories, or another way to achieve this (btw - I can't use
    > .htaccess) ?[/color]

    If you only want to set the include path, you can use ini_set to do the
    job like this:

    ini_set('includ e_path',dirname (__FILE__).'/php.ini');

    Put that in a file in your docroot, put the php.ini file in the same
    directory, then make sure that you include the file with that call in it
    in your script.

    --
    Justin Koivisto - spam@koivi.com
    PHP POSTERS: Please use comp.lang.php for PHP related questions,
    alt.php* groups are not recommended.

    Comment

    Working...