Issue with Lion and Apache with PHP includes

Joined
Nov 22, 2011
Messages
7
Reaction score
0
Points
1
Hi there..I have a strange issue. I have an AIR with LION and turned on Apache and installed MySql. Everything seems to work OK until I use an INCLUDE with PHP. At that point, I just get a blank page on the browser...I take out the include statement and works OK. I know I am using the right syntax as i put the script on a different server and it works fine.

So I am really confused. I dont even get error messages.

Any ideas?
 
Joined
Mar 16, 2007
Messages
756
Reaction score
14
Points
18
Would you be able to post here what your include statement looks like?

To me it sounds like there is an error or warning and Apache is configured not to display those.

Something to check: on that blank page, display the page source. Is there any sort of html code in there or is it empty?
 
OP
G
Joined
Nov 22, 2011
Messages
7
Reaction score
0
Points
1
This is all that is displayed

<html>
<head></head>
<body></body>
</html>


As for the line of code that is doing it... it is this:

include 'includes.php';

I also tried this:

include ('includes.php');

and this

include ('../includes.php');


Sometimes, when I refhresh, I also get the prompt of what I want to do with the file (Open or Save).

Weird.
 
Joined
Nov 23, 2011
Messages
6
Reaction score
0
Points
1
Do you have firebug installed on Firefox and if so does that give any errors ?
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,937
Reaction score
573
Points
113
Location
Queensland
Your Mac's Specs
Too many devices to list
Firebug won't notice anything since it focuses on HTML, CSS and JS.

Have you tried including different files? Are you trying to include something that you installed by chance?
 
OP
G
Joined
Nov 22, 2011
Messages
7
Reaction score
0
Points
1
Yeah...tried it with different files, in different locations, with different things. Once I link a file it does nothing.

Is there a way to turn on error reporting on Apache or something? If I had an error message..at least that would be something...
 
OP
G
Joined
Nov 22, 2011
Messages
7
Reaction score
0
Points
1
Also... it is nothing I installed. I am just linking a file that has functions in it that i can call later (Like Headers etc..). The weird thing is it works fine on the webserver that is on our cloud server...just not the MacBook Air localhost.
 
Joined
Mar 12, 2011
Messages
27
Reaction score
0
Points
1
Perhaps a rights issue on the folder with the scripts?? Dunno, but that's the first thing I'd check on a Windows server...
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,815
Reaction score
2,170
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Dumb question..you have enabled Apache and MySQL..does that automatically give you PHP? I think I had to specifically modify the Apache configuration to enable the PHP shared library and restart it..

Seeing what you are seeing without having the PHP libs loaded makes sense..
 
OP
G
Joined
Nov 22, 2011
Messages
7
Reaction score
0
Points
1
OK..so I found out the issue. 1) The error logs for Apache are your best friend :)...

2) For some reason, for PHP, I could just <? and ?> to break in and out of the script language on my web server, but on the LION apache version I needed to have <?php and ?>.

Strange, but I got it to work. GO figure.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top