A
A
Alexander Gorsky2014-07-26 23:29:34
PHP
Alexander Gorsky, 2014-07-26 23:29:34

PHP like fastcgi gives 403 error. What should I do?

There is a server with up-to-date, regularly updated software. There was a task to install php5.3 on it. It was decided to leave version 5.5 as an Apache module, and install the old one as fastcgi. As a result, 5.5 still works, and 5.3 writes to the browser that

You don't have permission to access /php53-cgi/index.php on this server.
and spits out the following in the logs:
[authz_core:error] [pid 17066] [client 127.0.0.1:57830] AH01630: client denied by server configuration: /usr/lib/cgi-bin/php53-cgi

The mentioned file contains the following spells:
#!/bin/sh
PHPRC="/opt/php5.3/"
export PHPRC
PHP_FCGI_CHILDREN=4
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS
exec /opt/php5.3/bin/php-cgi

Accordingly, the old version of php is installed in /opt/php5.3.
Googling has so far turned up nothing. However, there is a feeling that the error is probably trivial.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Igor, 2014-07-27
@alcanoid

And what about the rights to the problematic file and the directory where it is located:

ls -l /usr/lib/cgi-bin/php53-cgi
ls -ld /usr/lib/cgi-bin/php53-cgi

It looks for a site in /php53-cgi , since it requests /php53-cgi/index.php Which
user are you running the process as:
ps aux| php-cgi
In my opinion, you did not come to the simplest solution. Here's how you can do it, a little easier:
1. Download the source of the desired version of php.
2. Configure it with the necessary keys, for example like this:
Important here is:
--prefix - where everything will be put;
--with-config-file-path, --with-config-file-scan-dir - where we will keep the configs for this version.
3. Actually build via make, make install or checkinstall.
You can connect the desired version of php through .htaccess in the root of the desired site through the description of the handler, something like this:
Action php-script /usr/local/php5.3.27/bin/php
AddHandler php-script .php

O
Oleg Voitenko, 2014-07-26
@OliverV

build the fcgi genus binary correctly. In general, this is a rather hemorrhoid thing, two or more versions of puff on one piece of iron. copy-paste from mancala on the Internet will not fail. better hire an intelligent administrator, he will collect you correctly. I mean ./configure
that's where you need to print everything correctly.

Y
Yakov Akulov, 2014-07-27
@jakulov

You can solve a similar problem through chroot - everything will turn out much easier.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question