我刚安装了CentOS 5.8最后的64位机器上的nginx 1.1.13和php 5.4.0。 Nginx和PHP / Fpm正在运行,我可以通过ssh命令行运行php脚本,但是在浏览器中我总是收到'找不到文件'。 所有的PHP文件错误。 这是我如何让我的nginx.conf处理PHP脚本: location ~ \.php$ { root /opt/nginx/html; fastcgi_pass unix:/tmp/fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /opt/nginx/html$fastcgi_script_name; include fastcgi_params; } 这是从我的其他服务器的直接复制/粘贴,在这个设置工作正常(但他们运行旧版本的PHP / FPM)。 为什么我会收到这些错误?
我安装了LDAP开发标题: apt-get install libldb-dev 这添加了几个ldap头文件: root@crunchbang:/usr/include# ls -la ldap* -rw-r–r– 1 root root 9466 Apr 23 2013 ldap_cdefs.h -rw-r–r– 1 root root 1814 Apr 23 2013 ldap_features.h -rw-r–r– 1 root root 65213 Apr 23 2013 ldap.h -rw-r–r– 1 root root 9450 Apr 23 2013 ldap_schema.h -rw-r–r– 1 root root 3468 Apr 23 2013 ldap_utf8.h 当我configuration和引用目录时: […]
我正在使用nginx/php5-fpm与代码进行testing <?php header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found"); // also tested: header("Status: 404 Not Found"); echo $_SERVER["SERVER_PROTOCOL"]; 并强制使用curl命令使用HTTP 1.0 。 curl -0 -v 'http://www.example.com/test.php' > GET /test.php HTTP/1.0 < HTTP/1.1 404 Not Found < Server: nginx < Date: Sat, 27 Oct 2012 08:51:27 GMT < Content-Type: text/html < Connection: close < * Closing connection #0 HTTP/1.0 正如你所看到的,我已经在请求使用HTTP […]
我想locking我的PHPconfiguration,并禁用加载其他PHPconfiguration,而不是默认的(这在我的情况是位于/usr/local/php/lib/php.ini)我想禁用“扫描该目录aditional。 ini“,或者如果有办法将php.ini中的variables设置为永久的,我会去做。 有什么build议么 ? 提前致谢, 我。
我有一个社交网站,我想从网站上禁止用户。 我已经将他的IP地址添加到.htacess文件的禁止列表中, .htacess其禁用到了php级别,但是他不断使用不同的IP地址。 如何永久禁止用户,无论他多么努力地尝试重新进入网站?
我在Windows Server 2008上使用Web平台安装程序安装了多个drupal 7站点。 直到知道他们的工作没有任何问题,但最近内部服务器错误500开始出现(每一个这么多的请求一次),现在它发生的所有请求到任何的PHP网站。 没有太多的细节可以继续下去,在工作的时间和现在的时间之间没有任何变化(无论如何我也不知道) 日志文件充满了消息,如 [09-Aug-2011 09:08:04] PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0 [09-Aug-2011 09:08:16] PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0 [09-Aug-2011 09:08:16] PHP Fatal […]
我最近更新了我的.htaccess文件来隐藏URL的.php扩展名 。 它工作的很好,当我试图达到domain.com/index ,它显示的PHP文件。 当我键入domain.com/index.php时,它会将我redirect到domain.com/index url并显示.php文件。 我想将所有其他扩展名redirect到没有扩展名的url,出于安全原因显示.php文件。 我的问题是,我不能configuration我的.htaccess来redirect像.html .asp这样的众所周知的扩展。 aspx.shtml等转换为非扩展名的url,并获取显示为内容的.php文件。 我的.htaccess文件如下所示: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / # php extension to no extension url RewriteCond %{THE_REQUEST} ^[AZ]+\s.+\.php\sHTTP/.+ RewriteRule ^(.+)\.php $1 [R=301,L] # no extension to the .php file RewriteCond %{REQUEST_FILENAME}.php -f RewriteCond %{REQUEST_URI} !/$ RewriteRule (.*) $1\.php [L] # this is for the index RewriteRule […]
我有一个Apache 2.4 webserver,在CentOS的微型AWS实例上运行。 Apache使用prefork MPM模块运行PHP。 服务器通过亚马逊负载均衡器进行访问,该负载均衡器每60秒尝试访问一次服务器的index.php网页。 问题是,在1-2天之后,Apache用index.php页面打开了256个进程,出现以下错误: [Sun Sep 08 02:13:00.356051 2013] [mpm_prefork:error] [pid 1201] (12)Cannot allocate memory: AH00159: fork: Unable to fork new process [Sun Sep 08 02:13:13.656694 2013] [mpm_prefork:error] [pid 1201] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting 通常当发生这种情况时,不再接受新的http连接。 Apache可能不会closures负载均衡器的所有连接。 我们有另一台Apache 2.2的服务器,它没有这个问题,所以可能是2.4版本的问题,它比2.2(我们没有改变Apache的默认configuration)有很大的不同。 mod_status被启用,这是我们可以得到这种情况发生一次的输出: http : //www.speedyshare.com/vE3My/server-status.txt 有谁知道我们如何解决这个问题? 提前致谢!
似乎我的一些PHP应用程序需要PHP 5.2和一些需要PHP 5.3。 有没有办法configurationApache(V2.2.14),一个虚拟主机将与一个PHP库和一个不同的虚拟主机将需要一个不同的? 目前唯一的解决办法是安装两个apaches和两个phps,每个apache将驻留在不同的端口。 谢谢
使用PHP 5.2.6,需要将其configuration为使用我们的转发代理(需要进行身份validation),以便PHP脚本可以正确连接到Internet。 我发现4版本中的PHP.INI有一个pfpro.proxyaddress选项,但是这个选项已经不可用 – 那么replace它是什么?