Magento 2 Install

#1
I'm installing Magento 2.2.2 on Centos 7 using Litespeed PHP 7.1.14 and after the install, it appeared no CSS was applied. I found this solution to that problem:

php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
rm -rf var/cache/*
chown -R nobody:nobody

but when I run "php bin/magento setup:static-content:deploy" I get this error:

#!/usr/bin/env php
bin/magento must be run as a CLI application

On the server, other non-Magento php scripts launch without any problems from the command line.

I solved this by removing:

if (PHP_SAPI !== 'cli') {
echo 'bin/magento must be run as a CLI application';
exit(1);
}

from /bin/magento
 
Last edited:
Top