Welcome to WebmasterWorld Guest from 54.144.110.101

Forum Moderators: travelin cat

Message Too Old, No Replies

MAMP & PHP Includes

     
6:46 pm on Jun 24, 2007 (gmt 0)

New User

10+ Year Member

joined:Mar 23, 2005
posts:4
votes: 0


I installed MAMP and set up virtual servers for multiple sites. I have PHP includes for HTML files that aren't showing up. I've added "AddHandler application/x-httpd-php .html" and "AddType application/x-httpd-php .html" to the httpd.conf file but I just get empty spaces on the page where the php includes are. These work on my live site, no problem.

I've thoroughly scoured the MAMP forum and haven't found an answer. Hoping someone here has the answer!

11:19 pm on June 24, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 12, 2005
posts:5966
votes: 0


Have you restarted your server so that the changes take affect?
8:18 pm on June 26, 2007 (gmt 0)

New User

10+ Year Member

joined:Mar 23, 2005
posts: 4
votes: 0


Yes, several times--and I certainly realize it's easy to miss the obvious :-)
5:01 pm on June 27, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:June 9, 2005
posts:354
votes: 0


Do you have more than one site, or are using any subfolders to store sites inside your test server? If so you'll need to set DocumentRoot or aliases.

I took the easy route and bought Mamp Pro to set those up. It isn't hard to do manually... but I was too lazy and know zilch about setting up servers.

[edited by: LunaC at 5:04 pm (utc) on June 27, 2007]

6:48 am on July 2, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:June 25, 2002
posts:466
votes: 0


Line endings in the .htaccess or httpd.conf? I know this is a problem if you create or edit a .htaccess file on a Mac when using standard LAMP setup - the Mac uses LF for it's line ending by default, and Apache on Linux expects CR or CR + LF.
12:08 pm on July 2, 2007 (gmt 0)

New User

10+ Year Member

joined:Mar 23, 2005
posts: 4
votes: 0


LunaC: Yes, I do have subfolders for different sites, set up in the htdocs folder. I set up virtual servers in the httpd.conf, the Doc Root is easy to set in Mamp. The sites are displaying locally except for the includes, that is the only problem. However, I will try Mamp Pro. Thanks for the heads up.

ytswy: I edit my live sites httpd.conf and .htaccess files using a text editor (Smultron) and don't have any problems. That may have been a previous Mac problem, but no longer.

4:38 pm on July 2, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:June 25, 2002
posts:466
votes: 0


That may have been a previous Mac problem, but no longer.

Doesn't sound like it's your problem certainly, but just to point out to anyone who finds this thread when looking for .htaccess problems with Macs, that this issue is still alive and well with many Mac text editors - even Dreamweaver MX 2004 defaults to LF for line endings on the Mac. You can also get problems in php with functions such as fgetcsv() unless you configure php.ini to recognise LF as a line ending.

Sorry, off-topic for the thread, but I spent a *very* long time hunting this one down when it bit me, and I wouldn't wish it on anyone..

9:04 pm on July 2, 2007 (gmt 0)

New User

10+ Year Member

joined:Mar 23, 2005
posts:4
votes: 0


...php with functions such as fgetcsv() unless you configure php.ini to recognise LF as a line ending

There's always one more thang. Thanx mucho and I'll check this one out.

3:28 pm on July 3, 2007 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member 10+ Year Member

joined:Aug 1, 2003
posts:815
votes: 0


ytswy, I think you might be referring to CR (ASCII 13) and LF (ASCII 10) backwards.

From the Apple Apple Developer Site [developer.apple.com]

Unix (LF), Mac (CR), or Windows (CRLF)

And yes, Mac OS X has multiple personalities when it comes to line endings. It's the first thing I check when things "don't show up." I try to standardize everything to CR-LF -- I can't find the reference but I seem to recall that's the HTTP standard, and it seems to work the most places.

5:51 pm on July 3, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:June 25, 2002
posts:466
votes: 0


duh! Thanks timster, you're right of course.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members