php5.3.3 date.timezone again php.ini directive not taken into account

后端 未结 2 2024
南方客
南方客 2020-12-10 16:58

System: Debian Lenny/Apache 2.2/php5.3.3 compiled from sources

I\'m strugglying with the date.timezone within php.ini.

I can define the TZ using in the php s

2条回答
  •  -上瘾入骨i
    2020-12-10 17:44

    Hope it can help others on debian's like distros :

    SOLVED:
    needed to tell Apache to load the wanted php.ini file

    Context:
    PHP loaded as an Apache module (eg DSO)

    HOW in short :
    shell ENV

    PHP_INI_SCAN_DIR=/pathtophpini
    export PHP_INI_SCAN_DIR
    

    http.conf

    # ...
    # DSO Modules: PHP as an Apache module
    SetEnv PHPRC /usr/pathtophpini
    SetEnv PHP_INI_SCAN_DIR /usr/pathtophpini
    
    LoadModule php5_module /pathtophpmod/libphp5.so
    PHPINIDir /pathtophpini
    # ...
    

    Shell

    /etc/init.d/apache2 restart   
    

    Now just checking that the loaded configuration file php.ini is the right one either using the php-cli in commandline or phpinfo() :

    /path/to/your/phpcli/bin/php -i | grep php.ini | tail -n2   
    # which gives you the expected answer
    Configuration File (php.ini) Path => /pathtophpini/php.ini
    Additional .ini files parsed => /pathtophpini/php.ini
    

    Some more documentation :
    on that very particular point, provided there are very few docs on that subject, as this is a kind of shared responsability topic between apache and php matters :
    on stackoverflow
    on php manual
    askapache

提交回复
热议问题