1

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

EDIT2:

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 Apr 9 '15 at 3:25
  • looks like root, should I change this? – brentwpeterson Apr 9 '15 at 11:58
  • No, because others can execute php. If it was -rwxr-xr-- then there would be a problem. – SailorCire Apr 9 '15 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 Apr 9 '15 at 17:11
  • It will do the same thing via the Cron or manually. – brentwpeterson Apr 9 '15 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.