I am running a Magento application on a Nginx server.

nginx + php-fpm running as webuser:www

There are some function in the shell directory of Magento which run fine as root and the import run fine on our apache box. php 5.4

This run as webuser does not work php -f shell/importfromapi.php

but if I run as root it works fine? When I say it works fine I mean that using root I am able to confirm in the log that the api is connect and we get data. But using the webuser I get a blank response from the API

I can't find the error logs for php.

I found var/log/php-fpm/error.log but it does not log any error.

EDIT: Permission for php are root, should I change this?

ls -la /usr/bin/php
-rwxr-xr-x 1 root root 3865896 Mar 13 15:20 /usr/bin/php

I have done some more debugging:

curl -v http://api3.codebasehq.com/projects \
-u "myuser/keycombo"

The above is working from my webuser so it is not that. It has to be something in the PHP


I just checked out the app on a different server and ran the php command as the default web-user and it worked. I think it has something to do with php-fpm.

  • what are the permissions of php (which php and then do ls -la /path/to/php)?
    – SailorCire
    Commented Apr 9, 2015 at 3:25
  • looks like root, should I change this? Commented Apr 9, 2015 at 11:58
  • No, because others can execute php. If it was -rwxr-xr-- then there would be a problem.
    – SailorCire
    Commented Apr 9, 2015 at 14:53
  • In your tests, did you try to run this from the commandline yourself, both as root and as www? Or are you comparing commandline root to www triggered from a cronjob or fpm?
    – kojiro
    Commented Apr 9, 2015 at 17:11
  • It will do the same thing via the Cron or manually. Commented Apr 9, 2015 at 17:50


You must log in to answer this question.

Browse other questions tagged .