homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / WebmasterWorld / The Macintosh Webmaster
Forum Library, Charter, Moderators: travelin cat

The Macintosh Webmaster Forum

MAMP & PHP Includes

 6:46 pm on Jun 24, 2007 (gmt 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 Jun 24, 2007 (gmt 0)

Have you restarted your server so that the changes take affect?


 8:18 pm on Jun 26, 2007 (gmt 0)

Yes, several times--and I certainly realize it's easy to miss the obvious :-)


 5:01 pm on Jun 27, 2007 (gmt 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 Jul 2, 2007 (gmt 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 Jul 2, 2007 (gmt 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 Jul 2, 2007 (gmt 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 Jul 2, 2007 (gmt 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 Jul 3, 2007 (gmt 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 Jul 3, 2007 (gmt 0)

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

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / The Macintosh Webmaster
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved