Per-directory configuration

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • djn
    Senior Member
    • Mar 2004
    • 140

    #1

    Per-directory configuration

    Some time ago I noticed something strange running a phpinfo() on what was then CPanel17 (I believe it was a register_globals unexpectedly set to On while the default was Off) and Andrew made me aware that using a php.ini in a website folder does change more stuff than what's in the php.ini only.

    Today I found the time to test this and take some notes: I've run a phpinfo() on CPanel59 with a minimal php.ini (containing only register_globals = Off) and without it and run a diff on the resulting HTML. Might be useful to know that with even such a minimal config file:
    • PHP declares the loaded php.ini to be the local one
    • the ionCube PHP Loader, the Zend Extension Manager and the Zend Optimizer are not loaded
    • allow_url_include turns to Off
    • error_log changes from error_log to no value
    • error_reporting changes from 6135 to no value
    • expose_php turns to On
    • extension_dir changes from /usr/local/lib/php/extensions/no-debug-non-zts-20060613 to /usr/lib/php/extensions/no-debug-non-zts-20060613
    • include_path changes from .:/usr/lib/php:/usr/local/lib/php to .:/usr/lib/php
    • max_input_time goes from 60 to -1 (oops!)
    • memory_limit goes from 32M to 128M
    • output_buffering goes from no value to 0
    • precision goes from 12 to 14
    • safe_mode_exec_dir goes from no value to /usr/local/php/bin
    • sendmail_path doesn't really change, but has an added space at the end (?)
    • the ffmpeg-php extension is not loaded
    • mysql.allow_persistent turns to On
    • PDO, pdo_mysql and pdo_sqlite extensions are not loaded
    • registered save handlers go from files user sqlite to files user
    • session.save_path goes from /tmp to no value
    • the SQLite extension is not loaded
    • url_rewriter.tags changes from a=href,area=href,frame=src,input=src,form=,fieldse t= to a=href,area=href,frame=src,form=,fieldset=


    Anybody playing with the per-directory configuration of PHP might want to keep an eye on these values in case something behaves strange.
  • djn
    Senior Member
    • Mar 2004
    • 140

    #2
    Not sure if it's an effect of the upgrade to PHP 5.2.12, but suddenly the settings in a php.ini started to apply to subfolders too.

    Comment

    • CAD
      Junior Member
      • Mar 2004
      • 17

      #3
      is it possible to have different php.ini for every directory/subdomain?
      I need to set different include_path for every subdomain.

      I use it to running some demo/test/mockup sites to show to my clients. it is more simple than create cpanel account for every demo/test/mockup sites.

      Comment

      • ZYV
        Senior Member
        • Sep 2005
        • 315

        #4
        No, but you can use .htaccess to set PHP settings per directory. Refer to the recent posts in the annoucements forum.

        Comment

        • djn
          Senior Member
          • Mar 2004
          • 140

          #5
          It's the effect of the recent passage from Apache to LiteSpeed. Now a php.ini in the root folder applies to all subfolders, and php_value|php_flag commands in .htaccess are supported.

          Comment

          • CAD
            Junior Member
            • Mar 2004
            • 17

            #6
            thank you for the help..
            problem solved.. I use php.ini for main include in www directory, and use .htaccess for specific include in subdomain directory..

            Comment

            • djn
              Senior Member
              • Mar 2004
              • 140

              #7
              What's new with LiteSpeed

              Been playing a little with this thing, just being curious. What I found is that you can have conflicting instructions in your php.ini (root folder only, no effect elsewhere) and your .htaccess (think php_flag|php_value), and the winner is .htaccess. Instructions there trump over php.ini.

              Also, now we can do HTTP Authentication - as shown here. Nice.

              Comment

              Working...