Hy
I've updated my mamp2 to 3. after that i'll get the following error in apache (2.2.5)
[Wed Mar 12 09:10:58 2014] [notice] Digest: generating secret for digest authentication ...
[Wed Mar 12 09:10:58 2014] [notice] FastCGI: process manager initialized (pid 13431)
[Wed Mar 12 09:10:58 2014] [notice] Digest: done
[Wed Mar 12 09:10:58 2014] [notice] Apache/2.2.25 (Unix) mod_wsgi/3.4 Python/2.7.5 mod_fastcgi/2.4.6 mod_ssl/2.2.25 OpenSSL/0.9.8y DAV/2 mod_perl/2.0.8 Perl/v5.18.0 configured -- resuming normal operations
[Wed Mar 12 09:11:07 2014] [alert] [client 10.241.101.148] /Applications/MAMP/htdocs/dev/application/sites/mypage/public_html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
apache 2.2.5 / php version: 5.3.14
htaccess
php_value xdebug.profiler_enable_trigger 1
php_value html_errors On
php_value xdebug.scream 0
php_value display_errors on
php_value error_reporting 1023
php_value xdebug.max_nesting_level 150
php_value upload_max_filesize 70M
php_value post_max_size 75M
AddType text/x-component .htc
AddType application/vnd.ms-fontobject eot
AddType font/opentype otf
AddType font/truetype ttf
AddType application/x-font-woff woff
php_value newrelic.appname "myapp.ch.dev"
php_flag newrelic.enabled on
php_flag newrelic.browser_monitoring.auto_instrument off
some ideas? i'm not that fit in apache configs. thanks
In fact, modifying php.ini is actually more flexible than using php_value or php_flag: there are many things you can't override using .htaccess files, but you can override almost any PHP setting in the php.ini file. See our PHP support page for instructions on modifying php.ini.
Some PHP scripts suggest using " php_value " or " php_flag " commands in .htaccess files, as in this example: However, our servers run PHP in "CGI mode" as recommended by the PHP developers (not as an Apache module), so you can't use "php_value" or "php_flag" commands in .htaccess files.
To troubleshoot and fix an HTTP Error 500 in MAMP, you can try the following steps: Check MAMP’s error log and resolve any code problems that appear. Generate a fresh .htaccess file. Deactivate all of your WordPress plugins and test each one for problems.
Another possible source specific to errors on MAMP comes into play when your site encounters a PHP fatal error. This is often the result of misconfigured files or incorrect code. In these cases, checking the PHP error logs for your installation will often reveal the file that’s causing the issue, as well as the specific problem with the code.
php_value and php_flag aren't allowed directives in your .htaccess file if you're running MAMP's php in CGI mode.
Assuming you're using MAMP Pro, go to the Main MAMP window's PHP tab and make sure that "Mode" is set to "Identical PHP version for all hosts (module)". Restart your MAMP server and your .htaccess overrides should be ok.
If you must run PHP in CGI mode, you can put the overrides directly into your php.ini file instead.
If you can use php_value
on all other servers except your local one and you really want to use PHP in CGI mode (as it was in my case), you can locally use php.ini
file and add special condition inside your .htaccess
file to keep it in repository etc. while still avoiding 500s.
For instance by using this snippet of code:
<IfModule mod_php5.c>
php_value upload_max_filesize 200M
php_value post_max_size 200M
</IfModule>
you use php_value
only when it's possible (PHP as a module).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With