为了给一点背景,我有一个网站,允许用户上传图片。 WordPress用作内容pipe理系统,立即发布post,插入图片作为post的精选图片。 从那时起,图像以画廊风格格式显示。 近一年来,我有一个GoDaddy共享服务器上的网站,并没有上传的图像的问题。 随着网站的发展,我已经将网站转移到亚马逊实例。 在实例上是相应的MySQL数据库,虽然我知道它应该被设置为一个单独的实例,降低成本的时刻。 Web /数据库服务器位于c3.xlarge实例上。 不幸的是,现在大约50%的时间,当用户上传图片时,他们收到一个错误[内部服务器错误],并创build一个空白的post,随后包括在画廊。 显然,这是有问题的,因为画廊里充斥着空白的图像,这会损害用户体验。 当我查看WordPress的后端时,空白的后期图像是没有特色的图像,并且该后期被分类为未分类。 在这一点上,我认为这个问题源于服务器设置和与MySQL数据库的通信,但是我正在抓住吸pipe。 我已经在空白post的时间search错误日志,唯一的事情是我发现如下… [Sat Jun 14 19:23:51 2014] [error] [client xxx] (104)Connection reset by peer: FastCGI: comm with server "/usr/lib/cgi-bin/php5-fcgi" aborted: read failed, referer: http://example.com/upload/ [Sat Jun 14 19:23:51 2014] [error] [client xxx] FastCGI: incomplete headers (0 bytes) received from server "/usr/lib/cgi-bin/php5-fcgi", referer: http://example.com/upload/ [Sat […]
PHP正在我的服务器上运行,但我无法让它运行命令行。 我运行这个文件: <?php echo "done"; ?> 使用这个命令: php test.php 当我这样做,我得到这个错误: php: /usr/lib64/libssl.so.10: no version information available (required by php) 任何想法,为什么这可能是? 服务器是活的,所以我希望在进行任何可能会破坏我的设置的更改之前了解这里发生了什么。 我需要PHP来运行命令行,所以我可以得到一个电子邮件接收脚本工作。 我在nginx上运行php-fpm。 感谢任何指针 –
这是我的configuration(Nginx 1.7.x): server { listen 8000; index index.php index.html index.htm; root /var/www/; server_tokens off; chunked_transfer_encoding off; location ~ \.php$ { try_files $uri =404; fastcgi_index index.php; fastcgi_pass unix:/var/run/php5-fpm.sock; include fastcgi_params; fastcgi_keep_conn on; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; } } 和php-fpmconfiguration: [www] user = www-data group = www-data listen = /var/run/php5-fpm.sock listen.owner = www-data listen.group = […]
我刚安装了PHP的FPM 5.6.8,但它不会启动 – start php5-fpm给我一个Job failed to start消息。 我发现有几个人有西摩拉问题,但是没有一个答案似乎对我有用。 我尝试的一个解决scheme是使用/etc/init/php5-fpm.conf的命令,该命令是/usr/sbin/php5-fpm –nodaemonize –fpm-config /etc/php5/fpm/php-fpm.conf – 这返回-bash: /usr/sbin/php5-fpm: No such file or directory – 我想这是一个很大的线索,可能是错误的。 尝试运行在前台模式php5-fpm -y /etc/php5/fpm/php-fpm.conf告诉我The program 'php5-fpm' is currently not installed. You can install it by typing: sudo apt-get install php5-fpm The program 'php5-fpm' is currently not installed. You can install it by typing: […]
我的Centos 6.7服务器只有我的基于php和mysql的低stream量网站(所有网站每天总共约3000页的浏览量)使用nginx web服务器和virtualmin(没有wordpress或外部脚本/软件)。 我安装了PHP: yum –enablerepo=remi,remi-php56 install -y php-mysqlnd php-gd php-fpm yum安装了像php-commom,php-pdo等的依赖关系 我使用virtualmin在服务器上检查了正在运行的进程。 重新启动php-fpm之后,每个php-fpm:pool www进程都使用了大约400MB的内存。 etc / php.d目录中有20多个扩展名。 我评论了etc / php.d目录中的大部分扩展。 重新启动php-fpm和nginx之后, 我检查使用安装的扩展 <?php print_r(get_loaded_extensions()); ?> 这是结果: [0] => Core [1] => date [2] => ereg [3] => libxml [4] => openssl [5] => pcre [6] => zlib [7] => filter [8] => hash [9] […]
我已经看到更多的人有同样的问题,但他们的解决scheme没有为我工作。 我有centos 7 + nginx + php-fpm(版本7.1)。 当我尝试访问我的虚拟主机时,我得到“找不到文件”。 由php-fpm触发,这是我在nginx日志中看到的: 2017/02/27 11:18:54 [error] 7540#7540: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.56.1, server: site.dev, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "site.dev" php-fpm和nginx都与nginx用户一起运行 root 7539 0.0 0.0 45704 988 ? Ss 11:18 0:00 nginx: master process /usr/sbin/nginx -c […]
我有一个服务器块,如下所示: server { listen 80; # … location / { try_files $uri $uri/ /index.php?$query_string; # I've tried adding "$uri.php" like so, but it downloads the php file instead. # try_files $uri $uri/ $uri.php /index.php?$query_string; } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; fastcgi_index index.php; include fastcgi_params; } } 如果这样的请求来自http://example.com/random/page ,我需要Nginx将其重写到http://example.com/random/page.php而无需更改用户的url。 它还需要将该请求传递给其他位置块。 如果该文件不存在,它应该返回一个404。我怎样才能做到这一点?
PHP7和nginx这样安装在centos7上。 要安装php7 sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm sudo yum install php70w php70w-common 现在用php -v来检查它。 PHP 7.0.19 (cli) (built: May 12 2017 21:01:27) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.19, Copyright (c) 1999-2017, by Zend Technologies 安装nginx wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -ivh epel-release-latest-7.noarch.rpm sudo […]
我目前正在使用php-fpm和nginx运行一个Wordpress网站,并使用非常高的CPU速度。 这是我的www.conf文件: [www] user = www-data group = www-data listen = 127.0.0.1:9000 listen.owner = www-data listen.group = www-data pm = ondemand pm.max_children = 10 pm.start_servers = 20 pm.min_spare_servers = 10 pm.max_spare_servers = 30 pm.process_idle_timeout = 10s ping.path = /ping pm.status_path = /status pm.max_requests = 30 request_terminate_timeout = 20 我正在使用wp总caching和fastcgi。 你知道的任何文件,我可以find我可以显示。 我的网站每天获得大约800个视图,并且每天添加大约5-6次的内容。
我最近在Ubuntu 11.04上从源代码发行版安装了PHP 5.3.8。 这是我的configuration指令的第一部分: ./configure –enable-fpm –with-fpm-user=php-fpm –with-fpm-group=php-fpm –prefix=/usr/local/php-5.3.8 –exec-prefix=/usr/local/php-5.3.8 –with-config-file-path=/usr/local/php-5.3.8/etc –with-config-file-scan-dir=/usr/local/php-5.3.8/etc 之后,我下载了用于/etc/init.d/php-fpm的shell脚本文件的示例。 我从这里得到了脚本: http : //svn.php.net/repository/php/php-src/branches/PHP_5_3/sapi/fpm/init.d.php-fpm.in 。 我编辑了文件,并将path添加到相关位置,然后将内容复制到/etc/init.d/php-fpm。 我chmod + x php-fpm,然后尝试启动与./php-fpm start ,我得到以下错误: Starting php-fpm [07-Sep-2011 02:55:34] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98) 我改变了php-fpm.conf中的监听端口号,而且我仍然得到相同的错误。 有一件事我注意到,似乎没有创build一个php.ini文件。 我在我的前缀php目录和其他地方无处不在。 我不确定这是什么原因造成的问题。 我将不胜感激关于如何让PHP工作的任何指导。 谢谢。 编辑:这是我使用命令时得到的:lsof -i -P sshd 2267 root 3u IPv4 3188 […]