# Php5-fpm gives unknown script error

**URL:** <https://www.ruby-forum.com/t/php5-fpm-gives-unknown-script-error/244594>\
**Category:** NGINX\
**Created:** [May 9, 2016, 11:53pm UTC](https://www.ruby-forum.com/t/php5-fpm-gives-unknown-script-error/244594 "2016-05-09T23:53:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [May 9, 2016, 11:53pm UTC](https://www.ruby-forum.com/t/php5-fpm-gives-unknown-script-error/244594/1 "2016-05-09T23:53:45Z")

</div>

Hello list,  
I’m pretty new to Nginx, but I wanted to give it a shot. I like how it  
is  
configured–it makes more sense to me than Apache. However, I’m having a  
hard time with getting php. I’m running on Debian 8, and Nginx was  
installed with apt-get. I’ve installed php5-fmp, and can view php files  
in  
a browser.

The problem is that, during the installation of OSTicket, I got an  
error. I  
looked at Nginx’s log, and found a FastCGI error:

FastCGI sent an stderr: unknown script while reading response header  
from  
upstream

From what I’ve dug up thus far, this indicates a failure to resolve the  
path to a php script. My suspicion is that OSTicket is calling a script  
in  
a folder somewhere, and that path isn’t resolving. My location for php  
files looks like this:

server {  
#all the usual, much (but none of the SSL stuff) copied from

# [osTicket | NGINX](https://www.nginx.com/resources/wiki/start/topics/recipes/osticket/)

location ~ .php$ {  
fastcgi\_param SCRIPT\_FILENAME $document\_root$fastcgi\_script\_name;  
include fastcgi\_params;  
fastcgi\_param PATH\_INFO $path\_info;  
fastcgi\_pass unix:///tmp/php5-fpm.sock;  
}  
}

I don’t claim to understand what all this stuff is doing, but I hoped  
this  
might work. I know OSTicket doesn’t officially support Nginx yet, but  
since  
other people are having this problem for all kinds of scripts and  
situations, I thought maybe it was a more general problem I’d be able to  
fix. If anyone has suggestions, please let me know. If you need to see  
more  
configuration files, I can try to do that. The setup here is awkward  
(SSH  
from Windows to Debian, with no SCP support currently and no way to copy  
from or to the SSH session). I can copy files, but it’s a bit of a  
process.  
Anyway, thanks in advance for any ideas.

---

<div class="post-metadata">

**Author:** ![redroot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/919ad9/32.png) [@redroot](https://www.ruby-forum.com/u/redroot)\
**Post date:** [May 10, 2016, 2:22pm UTC](https://www.ruby-forum.com/t/php5-fpm-gives-unknown-script-error/244594/2 "2016-05-10T14:22:36Z")

</div>

On Mon, May 09, 2016 at 05:52:47PM -0400, Alex H. wrote:

Hi there,

without knowing anything about OSTicket…

> FastCGI sent an stderr: unknown script while reading response header from  
> upstream

That usually means that the fastcgi server could not find the file that  
it was looking for, based on what nginx told it.

So: what http request do you make?

What (php) file do you want the fastcgi server to use for this request?

> The setup here is awkward (SSH  
> from Windows to Debian, with no SCP support currently and no way to copy  
> from or to the SSH session). I can copy files, but it’s a bit of a process.

As an aside: if you can copy/paste words between your ssh session and  
your windows command prompt, you can use “tar” and “base64”, possibly  
also with “gzip”, to copy files from one to the other.

It can be annoying for large files, but anything that compresses down  
to some tens of kB is usually quite quick and easy.

Cheers,

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![redroot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/919ad9/32.png) [@redroot](https://www.ruby-forum.com/u/redroot)\
**Post date:** [May 10, 2016, 6:19pm UTC](https://www.ruby-forum.com/t/php5-fpm-gives-unknown-script-error/244594/3 "2016-05-10T18:19:14Z")

</div>

Just a note to say that I worked it out. I had my root set one level too  
deep, so the paths were rendering just fine but not matching up with  
where  
the root had them starting. Once I adjusted it, that problem went away.  
I’m  
still getting an error from OSTicket, but no longer am I seeing errors  
in  
my Nginx log. Incidentally, if anyone has gotten OSTicket to work under  
Nginx and wouldn’t mind emailing me off list, I’d love to pick your  
brain  
about what might be going wrong with the installation.

---

<div class="post-metadata">

**Author:** ![redroot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/919ad9/32.png) [@redroot](https://www.ruby-forum.com/u/redroot)\
**Post date:** [May 10, 2016, 3:22pm UTC](https://www.ruby-forum.com/t/php5-fpm-gives-unknown-script-error/244594/4 "2016-05-10T15:22:47Z")

</div>

On Tue, May 10, 2016 at 8:21 AM, Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> it was looking for, based on what nginx told it.
> 
> So: what http request do you make?
> 
> What (php) file do you want the fastcgi server to use for this request?

Looks like the request is for js/jquery.[number].js,  
ROOT/PATHcss/flags.css, and other files. I’m not sure which php file it  
is,  
since OSTicket is running its own installer. Well, the main file is  
install.php according to the “referrer” of the request, but I don’t know  
if  
that’s the whole story.
