E
E
egor_spk2015-08-13 11:48:47
PHP
egor_spk, 2015-08-13 11:48:47

Why is the php-fpm code not executing?

Hello.

The site works on a bundle: nginx + php-fpm.
There is a third-party converter on the site that opens from a separate page, but it does not work.
The code executes a post request to a php script:

$.post('convertor.php', {get_sites_arr: 1},
    function (responce){
...});


Where the following line should be executed:
if (isset($_POST['get_sites_arr']))
{
...
}


But the code is not executed and in the response I just get the source code of the convertor.php file.
The nginx config has the following:

server {
        listen 80;
        root /var/www/cy/;
        index index.php;
        server_name имя_сайта
        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;
        }
}


The converter itself is located in: site_folder/convert/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
magazovski, 2015-08-13
@magazovski

It's not entirely clear where you have convertor.php , maybe you need
$.post('/convert/i.html/convertor.php', ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question