Re: php_admin_value, virtual hosts, & upload_tmp_dir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Hogsett wrote:
Chris wrote:
Michael Hogsett wrote:
Why can I not set "upload_max_filesize" or "upload_tmp_dir" inside
my virtual host directive?  These are exactly the kinds of ini
directives that you would want to set per virtual host.

I can set "open_basedir" inside my virtual host using php_admin_value,
but neither of "upload_max_filesize" nor "upload_tmp_dir" take effect
unless I move those directives outside the virtual host configuration
and into Apache's global context.

Can anyone offer a suggestion as to how I would go about setting,
at the very least, "upload_tmp_dir" per virtual host?

I just tried it and it worked:

<IfModule mod_php4.c>
    php_admin_flag engine on
    php_admin_value upload_tmp_dir "/php_uploads"
</IfModule>

That was inside a virtual host...


Interesting. Here's a snippet from my httpd.conf file.

...

NameVirtualHost *

...

php_admin_value upload_tmp_dir /usr/local/www/subsite/virtual-server-hostname.domain/tmp/uploads/
php_admin_value upload_max_filesize "100M"

<VirtualHost *:80>
    ServerAdmin addr@domain
    DocumentRoot /usr/local/www/subsite/virtual-server-hostname.domain/data
    ServerName hostname.domain
    ErrorLog /var/log/hostname.domain-error_log
    CustomLog /var/log/hostname.domain-access_log common

<Directory "/usr/local/www/subsite/virtual-server-hostname.domain/data">
        Options FollowSymLinks MultiViews Includes
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

php_admin_value open_basedir "/usr/local/www/subsite/virtual-server-hostname.domain:/usr/local/share/pear"

    <IfModule mod_alias.c>
ScriptAlias /cgi-bin/ "/usr/local/www/subsite/virtual-server-hostname.domain/cgi-bin/" <Directory "/usr/local/www/subsite/virtual-server-hostname.domain/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>
    </IfModule>

</VirtualHost>



The two outside the VirtualHost work when they're there, but
do not work if I move them next to the entry for "open_basedir".
My error log states "php_admin_value not allowed here" when I
place them there.  Oddly it does not compain about the one
that is there now.

That is rather strange.

I'm running different versions of both php and apache but it works:

<VirtualHost _default_:*>
....
php_admin_value upload_tmp_dir /usr/local/www/subsite/virtual-server-hostname.domain/tmp/uploads
        php_admin_value upload_max_filesize "100M"
....
</VirtualHost>


That is - not inside the if_module section and it worked.

I thought maybe quotes around the path would make a difference but it didn't.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux