Mobile app version of vmapp.org
Login or Join
Jamie184

: Apache Unable to open logs: /Applications/MAMP/Library/${APACHE_LOG_DIR}/error.log I am trying to run a project built in Ubuntu with PHP on fat-free framework. I am using MAMP on macOS Yosemite

@Jamie184

Posted in: #Apache #Mamp #Php #Virtualhost

I am trying to run a project built in Ubuntu with PHP on fat-free framework. I am using MAMP on macOS Yosemite 10.10.1.

I imported a database successfully through phpmyadmin & following these instructions. My httpd-vhosts.conf file looks like this:

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot "/Applications/MAMP/htdocs"

<Directory "/Applications/MAMP/htdocs>
Options -Indexes FollowSymLinks Includes
AllowOverride All
Order allow,deny
Allow from All
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel debug

CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>


The project files are located at the "htdocs" web root folder in /Applications/MAMP/htdocs. Note that when I am trying to run it in this form the Apache server throws error, it does not run. When I comment the ErrorLog section the Apache server runs properly but all I get is a blank page.

The error message in the apache_error.log is:


No such file or directory: httpd: could not open error log file /Applications/MAMP/Library/${APACHE_LOG_DIR}/error.log. Unable to open logs

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Jamie184

1 Comments

Sorted by latest first Latest Oldest Best

 

@Megan663

It appears that your APACHE_LOG_DIR variable is not defined.

See this thread. It says that you need to define it in /etc/apache2/envvars. I'm not sure exactly where then envvars file would be on a Mac, but it should be with all the other apache2 configuration files.

Alternately, you should just use a hardcoded path rather than ${APACHE_LOG_DIR}. For example:

ErrorLog /Applications/MAMP/logs/error.log
CustomLog /Applications/MAMP/logs/access.log combined

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme