Discussion:
cakephp on MAMP
bdiddymc
2008-06-17 06:18:21 UTC
Permalink
Hello All...

This is my first post and I have a feeling i'm doing something stupid,
but can't find an answer...

I'm trying to set up cakephp onto my Mac with MAMP.

When I launch cake in the browser the page shows up, but it doesn't
look properly styled.

My research suggests its an issue with the mod_rewrite... but I can't
seem to find out how to solve it. Can anyone provide a link or the
steps that I need to do to fix it... I'd prefer to not use terminal.

Cheers
Lance Willett
2008-06-17 07:39:25 UTC
Permalink
Post by bdiddymc
When I launch cake in the browser the page shows up, but it doesn't
look properly styled.
My research suggests its an issue with the mod_rewrite... but I can't
seem to find out how to solve it.
Hi bdiddymc,
See "Beware the Finder and dot files":http://tinyurl.com/5572wp. A
very common error with the basic CakePHP setup on a Mac is moving
files with Finder, which doesn’t take .htaccess or other hidden files
by default. So you might be missing .htaccess files in your /webroot
directory and in your /app directory.

For some other common MAMP issues (MAMP default port, mysql.sock
setting, creating a virtual host for your CakePHP test site), see
"this thread":http://tinyurl.com/4balux.

If you are still having issues, you can use the "CakePHP Paste
Bin":http://bin.cakephp.org/ to post source code, like the HTML output
at `/your_install/index.php`. It might be helpful to see what the CSS
links look like, since you are mentioned that the view isn't styled
correctly.
leo
2008-06-17 08:23:42 UTC
Permalink
Have you tried phpinfo?

Sorry if this is beneath you, but create a file with the contents <?
php phpinfo() ?> make sure there are no spaces before or after the
chevrons. Save it as phpinfo.php and open it in your browser.

Search the results page for mod_rewrite (in apache2handler section,
loaded modules). If it isn't there, that's your problem. Then you'll
need to uncomment it in httpd.conf (or whatever your conf file is) and
restart Apache.

If it is there, then you probably have a dot file problem as described
by Lance.
Post by Lance Willett
Post by bdiddymc
When I launch cake in the browser the page shows up, but it doesn't
look properly styled.
My research suggests its an issue with the mod_rewrite... but I can't
seem to find out how to solve it.
Hi bdiddymc,
See "Beware the Finder and dot files":http://tinyurl.com/5572wp. A
very common error with the basic CakePHP setup on a Mac is moving
files with Finder, which doesn’t take .htaccess or other hidden files
by default. So you might be missing .htaccess files in your /webroot
directory and in your /app directory.
For some other common MAMP issues (MAMP default port, mysql.sock
setting, creating a virtual host for your CakePHP test site), see
"this thread":http://tinyurl.com/4balux.
If you are still having issues, you can use the "CakePHP Paste
Bin":http://bin.cakephp.org/to post source code, like the HTML output
at `/your_install/index.php`. It might be helpful to see what the CSS
links look like, since you are mentioned that the view isn't styled
correctly.
bdiddymc
2008-06-17 23:52:42 UTC
Permalink
Hi,

Thanks for the replies.

So using the CakePHP Bin do I just post the link here:
http://bin.cakephp.org/view/1954519462

That's the HTML output of the welcome page.

The css being used is:
<link rel="stylesheet" type="text/css" href="/cake/css/
cake.generic.css" />

I use TinkerTool to allow me to see hidden files and the .htaccess are
there for the /webroot directory and the /app directory.

I don't quite understand how to cover the mysql.sock setting (so
hopefully this is the issue and I can get it sorted). If I go to
/Applications/MAMP/tmp/mysql/
mysql.sock is a Unix executable file so I can't follow the given path
of:
/Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock

I also checked the phpinfo and mod_rewrite was in the apache2handler
section for loaded modules.

Any thoughts? Cheers
bdiddymc
2008-06-18 00:33:51 UTC
Permalink
looking at the CSS file... maybe it is working...? There's just not
that much styling made.

I thought the welcome page has a blue band at the top and some cake
branding?

Should the welcome page just be all white. Blue text header, yellow
subs, and grey behind messaged such as "Your database configuration
file is present."

(is it an older version that has the blue bands?)


It's not complete unstyled.
Post by bdiddymc
Hi,
Thanks for the replies.
So using the CakePHP Bin do I just post the link here:http://bin.cakephp.org/view/1954519462
That's the HTML output of the welcome page.
<link rel="stylesheet" type="text/css" href="/cake/css/
cake.generic.css" />
I use TinkerTool to allow me to see hidden files and the .htaccess are
there for the /webroot directory and the /app directory.
I don't quite understand how to cover the mysql.sock setting (so
hopefully this is the issue and I can get it sorted). If I go to
/Applications/MAMP/tmp/mysql/
mysql.sock is a Unix executable file so I can't follow the given path
/Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
I also checked the phpinfo and mod_rewrite was in the apache2handler
section for loaded modules.
Any thoughts? Cheers
leo
2008-06-18 08:39:02 UTC
Permalink
That sounds about right. Try changing the name of the css file to
something like XXX.cake.generic.css.XXX

That way, you'll be able to see what it looks like without styles.
Lance Willett
2008-06-18 14:48:14 UTC
Permalink
Post by bdiddymc
It's not complete unstyled.
So the CSS files were loading correctly, but you were getting a design
that you weren't expecting?

If you aren't familiar with Chris Pedericks's Firefox, I'd suggest
installing it right now: http://chrispederick.com/work/web-developer/.
It can turn CSS on off with one click, and you can test CSS, image,
and JavaScript external files to make sure they are loading as
expected.

On looking at your code paste, I noticed that the paths all include a
"/cake/" directory first, like "/cake/css/cake.generic.css". In most
cases you will want your DocumentRoot to point to the /path_to_cake/
app/webroot/, which means that the file paths look like this: "/css/
cake.generic.css" with no directory or "cake" in the paths. Unless you
are setting up a specific case where your CakePHP app is supposed to
be on a subfolder of a website rather than at the root. If you set it
up as detailed in the Manual's installation section (http://
manual.cakephp.org/view/32/installation), you will not see a reference
to "cake" in file or link paths.

Loading...