繁体   English   中英

MAMP 3,.htaccess和php_value

[英]MAMP 3, .htaccess and php_value

海兰

我已经将我的mamp2更新为3.之后我会在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版本: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

一些想法? 我不适合阿帕奇配置。 谢谢

如果你在CGI模式下运行MAMP的php,那么你的.htaccess文件中不允许使用php_value和php_flag指令。

假设您正在使用MAMP Pro,请转到主MAMP窗口的PHP选项卡,并确保将“Mode”设置为“所有主机(模块)的相同PHP版本”。 重新启动您的MAMP服务器,您的.htaccess覆盖应该没问题。

如果必须在CGI模式下运行PHP,则可以将覆盖直接放入php.ini文件中。

如果您可以在除本地服务器之外的所有其他服务器上使用php_value并且您真的想在CGI模式下使用PHP(就像我的情况那样),您可以在本地使用php.ini文件并在.htaccess文件中添加特殊条件保持在存储库等,同时仍然避免500秒。

例如,通过使用此代码段:

<IfModule mod_php5.c>
    php_value upload_max_filesize 200M
    php_value post_max_size 200M
</IfModule>

只有在可能的情况下才使用php_value (PHP作为模块)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM