cancel
Showing results for 
Search instead for 
Did you mean: 

suPHP and Magento 2 CLI

suPHP and Magento 2 CLI

I have been having a hard time installing Magento 2 on a cloud server to test out the new software - The hoops I have jumped through to get the 'Easy' installation wizard to compete and have a working website are the following:

  • Apparently suPHP has the user as the apache owner (although it is listed as 'nobody') so I have not changed user settings and therefore matches the owner of the files.
  • I had to set folder and file permissions to 755 and 644
  • Because PHP 5.5 is not currently default on the server I have added AddHandler application/x-httpd-php55 .php to the root .htaccess file.
  • I have had to boost the memory limit to get the installer to complete via .user.ini file in the root with memory_limit = 512M
  • I have had to edit the file permission constants in the following core files in line with above permissions: /vendor/magento/framework/Filesystem/DriverInterface.php and /lib/internal/Cm/Cache/Backend/File.php

I now finally have a functioning website with files being populated into the /pub/static/ folder - however I have not got the magento CLI to do anything with the account user or even the root user.

 

For example, by cron command is:

/usr/bin/php55 -c /home/<account>/<subdomain>/php.ini /home/<account>/<subdomain>/bin/magento cron:run

 

I get the following error:

---

  [InvalidArgumentException]                             

  There are no commands defined in the "cron" namespace. 

  Did you mean this?                                     

      setup:cron

---

 

I was getting a similar error when trying to get past the static files not being created in the /pub/static/ folder with the command: setup:static-content:deploy so I am now stuck with a website that I can not get to index or sent emails etc.

 

As per this thread which matches my situation I believe that that the issue may be permissions based and therefore possibly linked to suPHP and the owner of Apache but I am not sure how to approach this. I have contacted my server support who do not support software but had a quick look before recommending asking questions on the forums.

 

Can anyone offer any suggestions as to the correct permissions and ownership set up that might work?

 

Thanks in advance,

Steven

3 REPLIES 3

Re: suPHP and Magento 2 CLI

Today I thought I would try to update Magento as this would a) confirm that I could do something with the CLI that didn't generate an error and b) potentially (slim hope) refresh any files that may have been updated.

 

In the command line I entered:

/usr/bin/php55 -c /home/<account>/<subdomain>/php.ini /home/<account>/<subdomain>/bin/magento setup:upgrade

 

The server thought about this for a few seconds and then I get the following error:

---

[InvalidArgumentException]

The PDO extension is required for this adaptor but the extension is not loaded

 

[Zend_Db_Adaptor_Exception]

The PDO extension is required for this adaptor but the extension is not loaded

---

 

Obviously PDO is installed as it is a requirement of Magento and checked in the early installation stages.

 

I then executed the following command to see if I could see references to PDO:

---

/usr/bin/php55 -i

---

 

Scrolling through I found the following references to PDO which seems to confirm PDO modules are enabled:

---

PDO

PDO support => enabled
PDO drivers => sqlite, mysql

pdo_mysql

PDO Driver for MySQL => enabled
Client API version => mysqlnd 5.0.11-dev - 20120503 - $Id: <blah> $

Directive => Local Value => Master Value
pdo_mysql.default_socket => /var/tmp/mysql.sock => /var/tmp/mysql.sock

pdo_sqlite

PDO Driver for SQLite 3.x => enabled
SQLite Library => 3.6.20

---

 

I continue to be stumped. Any suggestions welcome.

 

Steven

Re: suPHP and Magento 2 CLI

I am having this issue too - I can't seem to find any resource on the correct permissions for suPHP.

Re: suPHP and Magento 2 CLI

My issue resolved itself by starting from scratch with a newer version (2.1.1). The whole installation process went a lot smoother and crons executed with minimal fuss.