Articles of PHP

nginx php5-fpm“文件未find” – FastCGI在stderr中发送:“主脚本未知”

所以我试图在debian wheezy服务器上第一次运行php5-fpm的nginx web服务器 打一个PHP文件显示简单的File not found 我已经做了研究(实际上浪费了很多时间),有很多人有类似的问题,但我没有成功地纠正它与他们的工作。 我仍然有同样的错误: $ tail /var/log/nginx/access.log /var/log/nginx/error.log /var/log/php5-fpm.log | less ==> /var/log/nginx/error.log <== 2013/10/26 21:36:00 [error] 6900#0:* 1971 FastCGI在stderr中发送:“主脚本未知” ,从上游读取响应头时, 我已经尝试了很多东西,很难记住什么。 我已经把我的configuration文件在github上 我的/etc/nginx/nginx.conf 我的/etc/php5/fpm/php-fpm.conf 目前,nginx.confconfiguration使用这个… server { server_name mydomain.tld; root /srv/data1/test; location ~ \.php$ { try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } /etc/php5/fpm/pool.d/www.conf包含listen […]

PHP应用程序在Nginx上打破了,但在Apache上工作

我想将一个PHP应用程序从Apache迁移到Nginx。 问题是,应用程序中断,因为路由不再工作,我不知道如何解决它。 PHP应用程序包含一些.htaccess文件,我试图将它们转换为Nginx。 第一个是在文档根目录下: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ public/ [L] RewriteRule (.*) public/$1 [L] </IfModule> 第二个是在/ public / <IfModule mod_rewrite.c RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Rewrite all other URLs to index.php/URL RewriteRule ^(.*)$ index.php?url=$1 [PT,L] </IfModule> <IfModule !mod_rewrite.c> ErrorDocument 404 index.php </IfModule> 第三个也是最后一个是: deny from all 我的nginx版本如下所示: #user nobody; […]

.php文件空白 – .php5文件有效

我的服务器有问题。 我已经安装了virtualmin / webinpipe理,我有1个域名。 DNSpipe理是外部的。 在这个领域,我只有一个HTML“在build”索引和5个子域名。 在所有这些子域中,我的PHP系统运行完美。 我试图在主域上安装Wordpress,并遇到一些问题:无.php文件加载。 我已经做了一个phpinfo文件来检查它,它也不会工作; 只出现一个空白页面。 当我在浏览器中检查它的源代码时,出现代码。 我已经改变了扩展名为.php5 ,它的工作完美。 有什么问题,但我不知道是什么。 我检查了Apache的错误,没有出现。 3天前我从php 5.2.*升级到5.4.21 。 服务器运行CentOS 5.10。

将PHP 5.5下调至5.4(CentOS REMI Repo)

我已经按照本指南安装了LEMP堆栈。http ://www.if-not-true-then-false.com/2011/install-nginx-php-fpm-on-fedora-centos-red-hat-rhel/ 我现在有最新版本的PHP v5.5。 然后我开始设置我的网站/脚本,其中一个需求是ionCube Loader(我的一些脚本是付费/编码脚本)。 所以,我跑了ioncube安装程序向导,才发现他们不支持PHP 5.5呢… 我现在需要降级我的PHP到5.4 …我怎么能这样做?

PHP MAIL()dsn状态

有没有一种方法来获得一个电子邮件的dsn状态与后缀,用PHP邮件function或任何其他库? 。 我可以parsing日志中的id和dsn状态,但是这对服务器来说不是很好,考虑到电子邮件的stream入。我需要一种方法来获取邮件的状态并将其存储在数据库中或文件。 谢谢,Alin

安装PHP 5.5.6:无法启动php-cgi.exe – MSVCR110.dll丢失

我试图从PHP 5.3更新到PHP 5.5后,从这里下载最新版本,我有这个错误: 无法启动php-cgi.exe – MSVCR110.dll丢失 我读过,我需要为Visual Studio 2012安装Visual C ++ Redistributable 。 是对的吗? 我不能只下载.dll文件吗? 为什么我应该安装VS只是为了使用PHP? 谢谢。

我们应该在Apache + PHP-FPM中有多个网站吗?

如果有很多小型网站(大约300个)在轻量级网站上运行,他们是否应该使用同一个池,还是为每个池设置单独的池? 让我们假设这些网站是可信的,并且在池中拥有一个单独的用户/组(例如,更好地控制访问/权限)在这里不被考虑。

无法使PHP在Apache VirtualHosting环境中工作

尝试在DigitalOcean云服务器下的新创build的CentOS节点中使用PHP设置Apache VirtualHosting环境。 麻烦的是,虽然虚拟主机本身是工作的,PHP不是 。 服务器设置: Web服务器:与Apache / 2.2.15的CentOS 6.5 PHP版本:5.3.3(用作Apache模块) 所采取的步骤: 以root用户身份login, 安装Apache和PHP: yum -y install httpd php 创build一个新的虚拟主机configuration文件,如下所示: 文件: /etc/httpd/conf.d/vhosts.conf NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin [email protected] ServerName example.org ServerAlias www.example.org DocumentRoot /srv/www/example.org/public_html/ ErrorLog /srv/www/example.org/logs/error.log CustomLog /srv/www/example.org/logs/access.log combined </VirtualHost> 为虚拟主机站点创build新的目录 如下所示, mkdir -p /srv/www/example.org/public_html mkdir -p /srv/www/example.org/logs 放置一个.php和.htmltesting文件,如下所示: /srv/www/example.org/public_html/ )下的文件 echo "<HTML>It work's</HTML>" > /srv/www/example.org/public_html/index.html […]

nginx + php-fpm上的Laravel返回空白页

我遇到了nginx + php-fpm提供的Laravel问题,它只是返回一个空白页面。 nginx,php和laravel都没有logging任何错误。 当使用CLI运行index.php时,它将返回欢迎页面。 laravel栈未触及,所有错误报告/显示/日志logging打开。 下面是我的nginx虚拟主机: server { listen 801; server_name _; root /path/to/laravel/public; index index.html index.html index.php; charset utf-8; gzip on; gzip_http_version 1.1; gzip_disable "MSIE [1-6]."; gzip_vary on; gzip_proxied expired no-cache no-store private auth; gzip_comp_level 9; fastcgi_buffers 8 16k; fastcgi_buffer_size 32k; fastcgi_read_timeout 180; # serve static files directly location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ { access_log […]

CentOS 6 Httpd无法启动

我正在使用CentOS 6.5。 Apache HTTP服务器(httpd)已经死了,原因不明。 我无法再访问http://localhost/ 。 当我尝试重新启动httpd时,失败(错误消息如下所示)。 ================================================== ================ 运行sudo service httpd restart时出现错误信息 Stopping httpd: [FAILED] Starting httpd: [ OK ] 存储在/var/log/httpd/error_log错误消息 [Tue Feb 04 14:44:57 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Tue Feb 04 14:44:57 2014] [notice] Digest: generating secret for digest authentication … [Tue Feb 04 14:44:57 2014] [notice] Digest: done *** […]