I’ve just upgraded my Mac, when I go to my projects the opening page loads fine (Minus the debugger toolbar) but all other pages return a 404 The requested URL was not found on this server. Just a blank page, no Yii style errorr. What are generally the errors that cause this. It is occuring with all my Yii2 projects. I have checked the permissions and they are all set at 777 as far as I can see.
I had the same problem when I upgraded to Mavericks a few months ago.
Chances are your web server config has been overwritten, likely things to be ruined:
-
Vhost overwritten
-
php.ini config file overritten (this would explain the apache error as mod_rewrite is probably no longer enabled)
This shouldn’t happen if you’re using MAMP, but if it has try reinstalling (backup your project files first)
When this happened to me, I opted to install Ubuntu on a virtual machine and do all my programming in there - Benefits are:
-
These kind of upgrades dont affect your webserver
-
Your development environment is closer to the environment that you’re going to deploy your sites on to
-
Much easier to install php extensions and other server tech (you don’t need to bother with the likes of macports)
-
You can add linux sysadmin to your list of skills

Good luck, Cheers
Ash
Thanks Ash,
I’d never thought of that. These are the things I have done to try and fix it. Made sure that the mod reqrite module is loaded in Apache2. I uncommented the line.
I’ve also made sure my vhosts is set up for localhost:
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Library/WebServer/Documents/
</VirtualHost>
My localhost itself seems to be fine. Just my Yii project
What other things can I do to try and narrow down the problem?
You will need to set AllowOverride. Very likely that is the problem now Heres an example for a Yii app using friendly urls:
<VirtualHost localhost:80>
ServerName localhost
ServerAlias www.localhost
ServerAdmin webmaster@localhost
DocumentRoot /Library/WebServer/Documents
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SetEnv APPLICATION_ENV ="development"
<Directory />
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
I’m not an expert on this stuff, in fact you’re nearing the end of my knowledge on vhosts. But try giving that a whirl.
One last thing actually. Make sure your hosts file is correct so that your web browser knows where to look for your server. On OSX
sudo nano /private/etc/hosts
and make sure this line exists:
127.0.0.1 localhost
Cheers
Ash
Thanks Ash, really appreciate your time here. As I’ve exhausted your knowledge I’ll throw it out to other Mac/Yii Afficianados. Im pretty sure it’s a Mac set up rather than Yii problem. I just downloaded a new Yii. Same problem.
AllowOveride All
Is your Friend ![]()
yep, I strongly recommend you stop using the OSX apache server, it’s only ever going to slow you down.
Thanks,
Do you have any links you’d recommend?