Tag Info

New answers tagged

0

After hours of searching and reading Apache documentation I've come up with a solution that allows to use the pool, and also allow the Rewrite directive in .htaccess to work even when the url contains .php files. <VirtualHost ...> ... # This is to forward all PHP to php-fpm. <FilesMatch \.php$> SetHandler ...


0

You never gave your nginx configuration. However, SIGTERM (15) on PHP-FPM children can be one of these: Open file descriptors too low (edit /etc/security/limits.conf and create an entry for your web user and set 'nofiles' to something higher). Also set rlimit_files to something higher in your PHP-FPM config if you use that You are using fastcgi_keep_conn ...


1

In my experience, a simple server structure as follows, which is enough for your case. Assumption You have about two hours to set them up. Server Environment Assumption 1 x Nginx server (Front-end, to process static files) 2 x PHP-FPM server (Back-end, to process PHP script) 1 x database server (Either in another separated server or in ...


0

Few days ago I had similar problem, when couple of php5-fpm masters spawned too much processes. OOM Killer helped a lot by killing nginx. As solution I found cgroup mechanism with memory subsystem. It allows to put all FPM processes in 1 group which is limited to e.g. 60% of system RAM. Great documentation: ...


2

Okay, you want to run multiple PHP version through nginx, the configure file should includes the specific path where you put your PHP scripts in different version or extension name. However, I would like to explain the SF question link given in your post. That answer is giving you a way to modify the conf of your nginx, which assumes that questioner has ...


0

Figured it out, for anyone else with the same issue, 403 forbidden access and selinux security error use this command on your servers root restorecon -r /srv/www/domain.com Fixed it for me and now everything is running as it should.


0

Solved it finally. SELinux was forbidding PHP-FPM from accessing the file since web content was served from /srv. Running the following command sudo chcon -R -t httpd_sys_content_t /srv/ solved the issue. Thank you everyone for helping. Reference: https://www.if-not-true-then-false.com/2011/install-nginx-php-fpm-on-fedora-centos-red-hat-rhel/


0

The 403 error message is misleading, but correct. Looking at /etc/apache2/conf-enabled/serve-cgi-bin.conf I have: <IfModule mod_alias.c> <IfModule mod_cgi.c> Define ENABLE_USR_LIB_CGI_BIN </IfModule> <IfModule mod_cgid.c> Define ENABLE_USR_LIB_CGI_BIN </IfModule> <IfDefine ...


0

I experienced this problem of no log files then noticed that I was accessing the URL over HTTPS instead of HTTP and that protocol had not been set up in Nginx so PHP5-FPM wasn't getting the traffic. Might help someone.


3

Your configuration is missing index index.php;.


1

You can add the following line to your wp-config.php file for direct filesystem writing: define('FS_METHOD','direct');


0

I gave finally Up, it is likely that it was due a defunction in the nginx packets. This morning i made a new installation of debian and the issue was gone.


0

I had this problem too, and I solved it by using TCP connections. Quoting this answer Error 502 in nginx + php5-fpm (found following the link from danmash): The issue is socket itself, its problems on high-load cases is well-known. Please consider using TCP\IP connection instead of unix socket, for that you need to make these changes: in php-fpm ...


1

No, you PHP code itself will not run faster, it's still the same interpreter. You might have a small latency profit compared to normal CGI, but who runs normal CGI anyway? ;-) Another small help could be the code caching, but that's only really useful if the script is run often.


0

One thing I came across in my dealing with this issue, is that if you use the combination of: chroot = /path/to/site chdir = / In your fpm pool configuration, don't pass the full path to the ProxyPass directive. ProxyPass fcgi://127.0.0.1:9020/$1 But -ONLY- if the pool on that port is chrooted.


0

Set PHP-FPM to ondemand, you're probably reaching the upper limit for worker processes


0

move this to bottom: location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi.conf; } And add fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; ...


1

In fact that's a very basic regex mistake you did there. As your second capture group in the fastcgi_split_path_info directive is (/.*) then the whole regular expression ^/~nik/(.+?\.php)(/.*)$ won't match /~nik/t.php as it's not followed by a slash. The question mark is also useless here while that's not the cause of the behaviour you see. The correct ...


0

No. It's valid. May be. You should really consider upgrading at least on last 5.3.x, but it's better to upgrade to some recent 5.x, since 5.3.x isn't supported anymore. Nope. I had such configuration working on all versions. Furthermore, having pm.max_requests set is a common practice. May be you just have to few workers running. You should really ...


1

OK I posted this ages ago and sort of gave up. Then I decided to revisit and did some research. My server uses APC opcode caching to improve php performance. I put an apc.php file in my site's root which allows me to see the stats of the cache. Fragmentation was at 100% and ti was getting over 50% misses. In the /etc/php5/conf.d/apc.ini file I just had to ...


0

i guess this is the cleanest method, without any ugly rewrites in apache config: <VirtualHost IP:80> ServerName domain.tld ServerAlias www.domain.tld DocumentRoot /var/www/project/web <FilesMatch \.php$> SetHandler proxy:fcgi://127.0.0.1:9000 </FilesMatch> <Directory /var/www/project/web> ...


2

Your CPU usage is caused by PHP-FPM, that is, your PHP code. Changing your nginx settings will have no visible effect on your CPU usage. Study your scripts and PHP setup. For example, if you don't have PHP Opcode cache enabled, enabling that helps a lot.


0

You could write out a dynamic php.ini by running something like <?php $s = array(); foreach(ini_get_all() as $k=>$v) { if ($v['local_value'] || $v['global_value']) { $s[] = sprintf("%s = %s", $k, $v['local_value']?$v['local_value']:$v['global_value']); } } file_put_contents("out.ini", join("\n", $s)); ?>


0

After inspecting the issue I found out, that the opcache error was triggered by an missing file, but that was not the problem. My php-version was installed without the zend thread safety feature. After installing php with zts everything is working fine now.


0

You're missing some of the required parameters from your apache configuration. This is the config that works for me: <IfModule mod_fastcgi.c> User apache Group apache AddHandler fastcgi-script .fcgi FastCgiConfig -idle-timeout 20 -maxClassProcesses 1 FastCgiIpcDir /var/run/mod_fastcgi Alias /php.fcgi /var/www/cgi-bin/php.fcgi AddType ...


1

One way you could try and tackle the problem is to fetch a coredump of PHP (after it segfaults), and then analyse coredump with GDB (with debuginfo packages installed on system). Then you could possible see what exact php line is giving you headache. Other then that - there's not much anyone can advise you on this one. ...


0

I continued digging until I found that mod_pagespeed was enabled! Disabling mod_pagespeed solved the issue.


1

I have found that, as of nginx 1.6.2 at least, the working syntax for me for the location block is: location ~ \.php$ { try_files $uri = 404; fastcgi_pass php fastcgi_index index.php; include fastcgi.conf; } that is: one should not specify the http:// protocol before referencing the php backend. The http://php syntax is to be used with the ...


-2

I also had the same error and I had to put in /etc/nginx/nginx.conf user www-data www-data;


0

You are using least_conn load balancing strategy in nginx for upstream PHP-FPM. This means that for one user that is at one IP address, might get served by a different PHP-FPM process. If these two PHP-FPM process don't share all necessary state between them about the user, then odd things can happen due to this. For example, if the user session state is ...


0

Hy, I had exactly the same question. And solved it, yay! Just try this: location / { try_files $uri $uri/ /index.php?$args; } location ~ \.(hh|php)$ { fastcgi_keep_conn on; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; # /checkout/ or /checkout - just try it out ...


1

Basically: No, not the information you're after, not on already running PHP processes. You might get something of use by running strace on one of the running processes (strace -p ), but only in as much as you'll see what system calls it's making, which might allow you to infer further information. But if it's stuck in a PHP-code loop (not making syscalls), ...



Top 50 recent answers are included