RE: [PHP] php.ini and .htaccess not working for php parameters
On 08 November 2006 23:04, James Tu wrote: Sorry...it was my own sillyness. After confirming that the .htaccess file was indeed setting the include_path directory, it turns out that the class file was renamed and PHP could not find it. I'm surprised that PHP doesn't complain that it couldn't find the file...then I started to comment out stuff in my .htaccess and it turns out that the culprit for now displaying errors was: php_value error_reporting E_ALL When I commented that out, PHP reported the errors. ugh! Can I set that parameter in .htaccess? Yes, of course -- but you need to take heed of the following CAUTION at http://uk.php.net/manual/en/configuration.changes.php: +-+ | PHP constants do not exist outside of PHP. For example, in | | httpd.conf you can not use PHP constants such as E_ALL or | | E_NOTICE to set the error_reporting directive as they will have | | no meaning and will evaluate to 0. Use the associated bitmask | | values instead. These constants can be used in php.ini | +-+ Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.ini and .htaccess not working for php parameters
Sorry...it was my own sillyness. After confirming that the .htaccess file was indeed setting the include_path directory, it turns out that the class file was renamed and PHP could not find it. I'm surprised that PHP doesn't complain that it couldn't find the file...then I started to comment out stuff in my .htaccess and it turns out that the culprit for now displaying errors was: php_value error_reporting E_ALL When I commented that out, PHP reported the errors. ugh! Can I set that parameter in .htaccess? -James On Nov 8, 2006, at 5:14 PM, James Tu wrote: I've setup a few directories under my dev server's webroot...one for each project. Under each project directory, I put php.ini files to set parameters such as include_path. For some reason they are not taking effect. Do I have to enable them somehow? phpinfo() tells me that Server API is Apache, so that means PHP is running as a module not as CGI right? So php.ini only works with PHP running as CGI? I tried to use an .htaccess file instead and that didn't work either. In my httpd.conf I have set Options All AllowOverride All Before, when I was using php.ini, i was getting an error from my include command...basically saying that it couldn't find the file. Now that I'm using the .htaccess, I don't see any PHP errors, I put some print statements just to see where things go wrong. include ('class.datetime_utility.php'); print hello; //shows up $dd = new datetime_utility(); print hello; //doesn't show up!!! What's happening here? (In the past, I just modified the include_path of the main php.ini and this doesn't seem like a flexible solution. I want to localize the settings in separate php.ini files for each project, so that when I have to deploy to production, I can also deploy the php.ini with minor adjustments.) -James -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php