Welcome to WebmasterWorld Guest from 54.159.190.106

Forum Moderators: travelin cat

Message Too Old, No Replies

MAMP & PHP Includes

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

10+ Year Member



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)

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



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

10+ Year Member



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

5+ Year Member



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)

10+ Year Member



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)

10+ Year Member



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)

10+ Year Member



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)

10+ Year Member



...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)

WebmasterWorld Senior Member 10+ Year Member



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)

10+ Year Member



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

Featured Threads

Hot Threads This Week

Hot Threads This Month