[PHP] php_admin_value, virtual hosts, & upload_tmp_dir
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? PHP Version 5.1.6 Apache 1.3, mod_ssl, and mod_php on FreeBSD 5.4. Thanks, - Michael Hogsett smime.p7s Description: S/MIME Cryptographic Signature
Re: [PHP] php_admin_value, virtual hosts, & upload_tmp_dir
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: php_admin_flag engine on php_admin_value upload_tmp_dir "/php_uploads" 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" ServerAdmin [EMAIL PROTECTED] 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 Options FollowSymLinks MultiViews Includes AllowOverride All Order allow,deny Allow from all php_admin_value open_basedir "/usr/local/www/subsite/virtual-server-hostname.domain:/usr/local/share/pear" ScriptAlias /cgi-bin/ "/usr/local/www/subsite/virtual-server-hostname.domain/cgi-bin/" AllowOverride None Options None Order allow,deny Allow from all 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. Likewise the only place (other than globally in php.ini) that I've been able to configure the include_path is within the .htaccess file inside my document root directory. I was unable to set this value inside the virtual host either. Perhaps I should wrap the directives in a conditional like you have. I've found the documentation on this to be very vague. - Mike P.S. Yes I want 100 meg uploads enabled, and yes I found out the hard way that I have to alter the max post size too. smime.p7s Description: S/MIME Cryptographic Signature
Re: [PHP] php_admin_value, virtual hosts, & upload_tmp_dir
Chris wrote: That is rather strange. I'm running different versions of both php and apache but it works: php_admin_value upload_tmp_dir /usr/local/www/subsite/virtual-server-hostname.domain/tmp/uploads php_admin_value upload_max_filesize "100M" 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. Thanks for your help Chris. I guess I'll have to keep looking. Do you think there's any chance that it would be related to some other setting within the php.ini file? smime.p7s Description: S/MIME Cryptographic Signature
Re: [PHP] php_admin_value, virtual hosts, & upload_tmp_dir
Chris wrote: php_admin_value upload_tmp_dir /usr/local/www/subsite/virtual-server-hostname.domain/tmp/uploads php_admin_value upload_max_filesize "100M" I'm fairly sure you can't use constants or size shortucts (like "100M") anywhere but php.ini. Maybe it works in the global scope because it gets read into PHP before it parses php.ini? That is an interesting supposition, although I don't think that would not explain the upload_tmp_dir file path also not working. - Mike smime.p7s Description: S/MIME Cryptographic Signature
Re: [PHP] php_admin_value, virtual hosts, & upload_tmp_dir
Richard Lynch wrote: The badly-named and oft-misunderstood "safe_mode" is my GoTo for Blame Analysis on stuff like this... :-) I checked. It's off. This is not Science, but Voodoo Debugging... No doubt. Thanks for the info. - Mike smime.p7s Description: S/MIME Cryptographic Signature