PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
publicGenome wrote:I checked:
/var/log/apache2/error_log
Found error:
[text]
learn_routing/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
[/text]
Awesome.
Pro tip: use virtual hosts for your projects and have separate log directories / files for each project. /var/log/httpd/project-name/error.log means not having to sift through errors from unrelated code.
Hi Cel,
Thanks so much for your support throughout this process.
Yes, I got similar advice earlier for v-hosts.
I'm yet to learn on how to set it.
Will work on it, and proceed, and come back should I face any error.
Thank you again.
--pG
In your Apache config, make sure this is uncommented
[text]# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf[/text]
In that file, add something like this:
[text]<Directory "/Users/your-username/Sites/">
Options FollowSymLinks Indexes Multiviews
AllowOverride All
Require all granted
</Directory>
Include /Users/your-username/Sites/.vhosts/*.conf[/text]
which will include all virtual host definitions in ~/Sites/.vhosts (I use a hidden directory so it doesn't clutter up Finder, but that's up to you).
Finally, create your virtual host definition
[text]<VirtualHost *:80>
ServerName magical-unicorns.dev
DocumentRoot "/Users/your-username/Sites/your-site/public"
ErrorLog "/Users/your-username/Sites/your-site/logs/error.log"
CustomLog "/Users/your-username/Sites/your-site/logs/access.log" common
</VirtualHost>[/text]