Setup problem with a project on the Mac

Hello everybody

I’m working on project here on Mac Snow Leopard. The project works with Yii.

I checkout the project with svn and put it inside localhost/project_name: I’m trying both with Mamp and Xamp.

The project works with .htaccess. I can see only the index.php page without dynamic contents. I get 404 error for all the other sections of the project.

DB is installed with it’s own permissions. I grant all permissions on the main directory and all sub directory and files with right click–> information. Everybody can write on everything inside the proeject directory.

Checking out the same project on windows vista, everything works fine.

So I think that I’m missing something here on Snow Leopard. I have the latest version of the OS. The same thing for MAMP and XAMPP. I assume that mod_rewrite is activated on tha last versione of MAMP and XAMPP.

Really frustrating.

As I already answered you on the italian forum… check the Yii requirements first… to see if something is missing…

Check requirements, as you were advised, that is - with freshly installed framework, point your web browser to requirements subfolder of your framework folder to see if your system / server meets all the minimum requirements.

If this pass with no problems, look for hangman demo app as this is smallest, purest webapp in framework release. Look, if you can use it.

mod_rewrite is not related to server packages (like XAMPP) but to apache itself. And yes - it is always enabled in XAMPP release (don’t know about MAMP).

If you are unable to follow any link on startup application created with yiic webapp then your DB configuration has nothing to do with it as second link leads it to a displaying static page, where database is not involved at all (i.e. you should be able to display static pages even with wrong DB configuration or with no DB at all).

First of all: thanks for your help.

Requirements are ok: only 2 warnings.

The hangman demo is working: I can play the simple game. If the game is using mod_rewrite, it works outside my project.

All the project has dynamic url: but I can see only the homepage without any dynamic content. If I try to navigate inside the website, every internal link says error 404. On windows vista everything works fine.

So it should be a Mac problem.

The project has no static pages.

Today I used the Terminal on mac to change all the privileges in all the directorys and files inside project root to 777. So everyone can read and write.

Any idea?

Yes, Hangman demo certainly uses mod_rewrite! See example URL from the game:


http://localhost/hangman/index.php/game/guess/M

Sorry, but I don’t get what you mean by “it works outside my project”?

If hangman works, that means mod_rewrite works. Your server is properly configured for either run Yii apps or use mod_rewrite Apache plugin. I would then advice to double or even triple check your code as it seems, mistake is somewhere inside your code and it is not related to configuration of Yii/Apache.

Try to FTP copy this project to some Unix/Linux server to see, if it works there, i.e. to make yourself sure that it works only under Windows because maybe there are somewhere Windows-like path separator (\), which are incorrect under Linux/Unix (using / instead) and probably under Mac too.

Maybe try to run Windows under Mac, if you have any port or virtual machine or sth, if you have access to such tool. And under that Windows try to install Appache / XAMPP and point it to run files from the same location as you are running on Mac (i.e. don’t copy them to virtual machine’s virtual harddrive). But I believe that this step will cost way too much work than results in can bring.

I’m running out of idea what can be wrong and what else can you check? Have you tested other demo apps that ships with Yii (not only hangman)? Do they work? Have you tried to generate fresh webapp by using yiic webapp and see if it works too? Try to download any demo application, not your own work to see if it works? Is your project the only one that fails to work or do you found any other application or piece of code written in Yii not by you that also does not work?

Hello and thanks again.

Just one thing: I’m only a web designer. So I have only really small server side programming skills. The project under yii framework is develpoed by another person.

By the way, if I put a new copy of yii inside ../MAMP/htdocs/yii all the demos are full working.

So like you said, mod_rewrite is working.

The programmer works with linux and the demo of the project is also online under a linux server.

I don’t use virtual machines. I have a mac and a pc with windows vista. I use virtual hosts. I can try to edit the host file on the mac to point the windows copy. Or try to put everything inside a virtual host on the mac and see If I can see it on windows.

I really hate virtual machines…

I’ve tested another project of the same programmer under yii framework. And I have the same problems: I can see only the homepage. All the other internal links are not working: error 404.

I can see the .htaccess downloaded with svnx (all the files starting with a "." are invisible here on the mac) and edit it with dreamweaver.

Mod_rewrite is working with the yii demos.

I changed all permission to htdoc root with the terminal in this way: sudo chmod -R 777 /path_to_htdoc

Now I try to view the copy hosted on the mac from windows editing the host file. And vice versa.

Trejder, thanks again for all your really useful suggestions. If you have other ideas, let me know.

If I put a copy of the project inside a virtual host on the mac, it doesn’t on mac and doesn’t work if I try to view it from windows vista editing the host file.

Vice versa. I have a copy of the project inside xampp on windows without a virtual host: it’s inside htdoc/project_name. It works on windows.

If I edit the host file on the mac to point the project under xampp in windows vista it works!

I also have the yii demos hosted in htdoc directory of xamp in windows: i can see them both on mac and windows.

summary:

hosting the project on MAMP on Mac OS (inside a virtual host)

Mac view: I can see only the homepage without dynamic content

Windows view: I can see only the homepage without dynamic content

Hosting the project on Xamp in Windows OS (not inside a virtual host but in Xamp htdoc/project_name)

Mac view: the project works!

Windows view: the project works!

Hosting the yii demos on Xamp in windows OS (not inside a virtual host but in Xamp htdoc/project_name)

Mac view: the demos are working!

Windows view: the demos are working!

So the project works on the mac if it is hosted on windows xamp.

I can see the project working from MacOs if it is hosted online inside a linux server.

Do I have to learn something from this?

There aren’t many things I can suggest you now, as I’m running out of ideas and as you did a lot of testing.

I would use XAMPP from the begining, as I love this server package and don’t like any other. If I understand you well, you wrote that you can run demo under XAMPP. Can you run your project also and see something else than start page and 404 error on anything else?

Try to remove (delete) .htaccess from protected folder inside your project (or better just rename it) to see if anything change. If you will see other pages, not 404 after deleteing .htaccess or renameing it to something else, then it would 100% mean that your server configuration is wrong and it is incorrectly processing Apache access files.