Results 1 to 12 of 12
  1. #1


    Member Since
    Nov 22, 2011
    Posts
    7
    Issue with Lion and Apache with PHP includes
    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?

  2. #2

    dekan's Avatar
    Member Since
    Mar 16, 2007
    Posts
    756
    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?

  3. #3


    Member Since
    Nov 22, 2011
    Posts
    7
    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.

  4. #4


    Member Since
    Nov 23, 2011
    Posts
    6
    Do you have firebug installed on Firefox and if so does that give any errors ?

  5. #5


    Member Since
    Nov 22, 2011
    Posts
    7
    I do, and no errors.

  6. #6

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,745
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    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?
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  7. #7


    Member Since
    Nov 22, 2011
    Posts
    7
    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...

  8. #8


    Member Since
    Nov 22, 2011
    Posts
    7
    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.

  9. #9


    Member Since
    Nov 22, 2011
    Posts
    7
    Anyone?

  10. #10

    sierraphotog's Avatar
    Member Since
    Mar 12, 2011
    Posts
    27
    Perhaps a rights issue on the folder with the scripts?? Dunno, but that's the first thing I'd check on a Windows server...

  11. #11

    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    8,356
    Specs:
    27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3
    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..
    --
    Regards
    ...Ashwin



    Be sure to read the Community Guidelines | The more information you provide, the better answers you get, remember GIGO.

  12. #12


    Member Since
    Nov 22, 2011
    Posts
    7
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Apache and PHP
    By giszzmo in forum OS X - Operating System
    Replies: 3
    Last Post: 09-24-2011, 05:16 PM
  2. Enable Apache and PHP
    By jacnmrb in forum Running Windows (or anything else) on your Mac
    Replies: 0
    Last Post: 08-05-2011, 04:17 AM
  3. Resetting PHP and Apache
    By Dashman in forum OS X - Operating System
    Replies: 4
    Last Post: 11-19-2007, 06:35 AM
  4. Apache/PHP
    By psychotoe in forum OS X - Development and Darwin
    Replies: 2
    Last Post: 08-12-2004, 07:10 PM
  5. Apache + PHP + MySQL
    By Emrys in forum OS X - Development and Darwin
    Replies: 2
    Last Post: 11-14-2003, 02:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •