我正在尝试在我的服务器上添加一个维基媒体网站,该服务器上已经有另一个网站(不使用PHP)。 我想把它放在不同的文件夹,如www.hostname.com/wiki,但它有两个不同的conf文件,以避免混合的东西将是美好的。 目前我正试图把这个维基媒体网站放在不同的港口,81号,还有一些问题。 我的nginx.conf如下所示: user nginx; worker_processes 1; error_log /var/log/nginx/error.log; #error_log /var/log/nginx/error.log notice; #error_log /var/log/nginx/error.log info; pid /run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr – $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; keepalive_timeout 65; index index.html index.htm index.php; include […]
我的PHP会话是: session.save_path = /var/lib/php/session 如果我做一个简单的脚本来testing像: session_start(); $_SESSION['hi'] = 1; var_dump($_SESSION); 那么会议不工作。 当我列出文件夹:“/ var / lib / php / session”我发现它每次都创build一个新文件。 所以,如果我重新加载页面1000,我将有1000个会话文件..它失去了会议,并创build一个新的。 所以它有权写入文件,但由于某种原因,它总是创build一个新的会话。
从Stackoverflow移动的问题 我有一个处理来自客户端的请求的PHP脚本。 我应该处于处理1000个并发请求(使用apache基准)的情况。 当我现在运行300个并发请求的Apache基准testing时,我能够处理所有的请求。但是,当我超过300的标记,Apache无法处理它。 (它退出与apr_socket_recv:连接重置由同级(104)) 这是Apache的错误日志。 [Thu Oct 29 11:20:34.984542 2015] [mpm_prefork:notice] [pid 6244] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.13 configured — resuming normal operations [Thu Oct 29 11:20:34.984581 2015] [core:notice] [pid 6244] AH00094: Command line: '/usr/sbin/apache2' [Thu Oct 29 11:21:38.638943 2015] [mpm_prefork:error] [pid 6244] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting 这是mpm preforkconfiguration […]
我有一个虚拟主机(php-fpm / apache)configuration的问题。 它会抛出下面的错误: name ProxyPass worker name (unix:///var/www/vhosts/system/site/php-fpm.sock|fcgi://127.0.0.1:9000/var/www/vhosts/site/httpdocs) too long… 我知道我可以很容易地用符号链接解决它,或者只是通过删除unix套接字或fgcid部分。 但我正在想另一种方式。 我想知道是否可以使用apxs构buildmod_proxy模块,将PROXY_WORKER_MAX_NAME_SIZE设置为大于96个字符,然后将其安装到我的Apache 2.4。 我怎样才能做到这一点?
说有一个由docker供电的应用程序。 可能有容器的数据库,Redis等和实际的Web容器(在我的情况下,它是PHP的FPM和Nginx的)。 或者,它可能是一个纯粹的Web节点,只有Web容器运行。 我的问题 – 有一个单一的主机上有一个这样的Web容器(PHP的FMP&Nginx的)有什么好处吗? 会提高性能吗? 它会降低性能吗?
我已经设置nginx和php 本教程build议。 我创build了第二个虚拟主机,如下所示: server { listen 80; root /projects/mydomain/; index index.php index.html index.htm; server_name mydomain.gr; location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } PHP和Nginx的工作正常,如果我访问mydomain.gr/index.php但当我访问mydomain.gr它将下载一个文件与index.php的内容和名称是下载。 我究竟做错了什么?
我有一个非常低级的VPS – 1GB内存和1个CPU(30gb SSD,运行CentOS(v7.2.1511))。 服务器只有服务器php-fpm(v5.4.16)和nginx(1.6.3)。 Mysql和Mongo数据库位于另一台服务器上。 我知道我的服务器规格非常低,但是我每秒获得的性能低于1个,速度非常慢 – 大约需要20秒来运行PHP脚本。 静态内容运行速度非常快。 这是永恒的dynamic内容。 这是我的configuration文件: # php-fpm.d/www.conf: listen = /var/run/php-fpm/php-fpm.sock pm = dynamic pm.start_servers = 3 pm.min_spare_servers = 2 pm.max_spare_servers = 5 pm.max_children = 5 php_value[session.session_handler] = files # nginx.conf worker_processes = 1 events { worker_connections = 512; } http { log_format main '$remote_addr – $remote_user [$time_local] "$request" […]
这是我目前的nginxconfiguration: server { server_name mydomain.example; access_log /srv/www/mydomain.example/logs/access.log; error_log /srv/www/mydomain.example/logs/error.log; root /srv/www/mydomain.example/public_html; error_page 404 /404; location / { if ($request_uri ~ ^(.*)\.(php|html)$) { return 302 $1$is_args$args; } try_files $uri $uri/index.html $uri/index.htm @php; index index.html index.htm index.php; } location @php { include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php-fpm/www.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; try_files $uri.php $uri/index.php =404; } location /support […]
我有一个基于官方PHP Docker镜像的 Docker应用程序。 我已经扩展它来更新cURL并使用nghttp2和openssl ,这是我的应用程序需要HTTP / 2支持。 但是,PHP本身并没有反映这个变化,我不知道为什么。 这是我的Dockerfile: FROM php:7.0.3-fpm # Add sources that allow installation of unstable packages (needed for latest OpenSSL/cURL versions). RUN echo 'deb http://ftp.uk.debian.org/debian testing main contrib \n\ deb-src http://ftp.uk.debian.org/debian testing main contrib \n\ deb http://ftp.debian.org/debian/ jessie-updates main contrib \n\ deb-src http://ftp.debian.org/debian/ jessie-updates main contrib \n\ deb http://security.debian.org/ jessie/updates main […]
我有wordpress安装在域的根目录。 我使用漂亮的链接和快速的cgicaching。 现在我在根目录(eG“/ course /”)中有一个目录,其中包含一些与wordpress无关的.php文件。 我很想访问这些没有.php扩展名的文件。 在另一台服务器上,一切都在根目录中设置,我不使用wordpress它的这些服务器块的补充: location / { try_files $uri $uri.html $uri/ @extensionless-php; } location @extensionless-php { rewrite ^(.*)$ $1.php last; } 我正在努力让它在我的WordPress的服务器上工作。 也许我错过了一些东西,这里是完整的服务器块: server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /var/www/html; index index.php index.html index.htm; client_max_body_size 10M; server_name example.com www.example.com; location ~* "^/something" { rewrite ^ http://example.com/curso-gratis-habitos/$ $1?ref=conlasalud permanent; […]