I
I
IPv42015-07-10 05:06:58
PHP
IPv4, 2015-07-10 05:06:58

How to feed php-fpm bash script?

There is a location:

location / {
      include         fastcgi_params;
      fastcgi_pass 	unix:/var/run/php5-fpm.sock;
      fastcgi_param 	SCRIPT_FILENAME /var/www/cgi-bin/script.sh;
    }

When I open the page, I get the output of the contents of the script itself.
Neither php-fpm spits errors nor nginx. Where to dig? How to add a valid #!/bin/bash header for php-fpm?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Fateev, 2015-07-10
@IPv4

You can just run it with HttpLuaModule

location / {
  content_by_lua 'os.execute("/var/www/cgi-bin/script.sh")';
}

Or use via CGI with fastcgiwrap and spawn-fcgi

E
Ergil Osin, 2015-07-10
@Ernillew

I propose to continue the questions.
"How to feed MySQL config from PostgreSQL?"
"How to cross an amoeba and a monkey?"
"How to use the monitor as a door lock?"
No way.
php-fpm is not for bash.
Handle bash scripts differently.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question