I am trying to install and configure PHP 7.2 on my MacOS Sierra. After installation, I failed to start Apache server and getting following errors.
No such file or directory: AH02291: Cannot access directory '/usr/logs/' for main error log
AH00014: Configuration check failed
I also tried to create '/usr/logs/' directory but it is not permitted. Commands I am using:
$sudo apachectl start
$apachectl configtest
Any help?
Apache needs write permissions for logs:
On osx /usr is a protected directory, system does not allow creating subdirs in it manually.
sudo mkdir /logs
sudo chmod 775 /logs
sudo chown {your-apache-user}:{your-apache-group} /logs
Much better option: use Vagrant https://www.vagrantup.com/ , that way you wont trash your OS