Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Loading php pages

    Hello I am new to the forum and I am having issues loading php pages. I installed apache and php. At first when I would complete a php code and place it in my document root folder, it would open on my browser no problem. But lately when I try to open it on my browser, I always get the option to either open with a program or save it. So now I cannot view my php pages on my browser. Has anyone experienced a problem like this? Thank you very much for your help in advance.

  • #2
    New Coder
    Join Date
    Dec 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmm... Did you open your apache? Cos u need to start your apache first before u can view it.

  • #3
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,835
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Are you using a MS Windows OS? If so, perhaps, you need to go into Windows Explorer, select Folder Options under Tools, then the File Types tab, and choose a program (i.e., a browser) to associate with all files with the .php file extension....just a guess
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ …Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Quote Originally Posted by chump2877 View Post
    Are you using a MS Windows OS? If so, perhaps, you need to go into Windows Explorer, select Folder Options under Tools, then the File Types tab, and choose a program (i.e., a browser) to associate with all files with the .php file extension....just a guess
    No, the problem is server-side. You don't have the web server setup correctly to handle php files.
    Or it might not even be started like zHen said.

  • #5
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hmm... I double checked to make sure apache was started and it was. It worked fine before but recently it has been funny. I set up all the files like I read, and it worked normally before so I'm not sure what the issue is.

  • #6
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Check the httpd.conf and make sure PHP is setup.

  • #7
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    hes not looking at the page properly, make sure u got http://localhost/folder/pagename.php or http://yourip/folder/pagename.php

  • #8
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    That's not the problem:
    Quote Originally Posted by onet0o View Post
    ...it would open on my browser no problem. But lately when I try to open it on my browser ...
    onet0o should know how to do that if it used to work.

  • #9
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    I am not sure 100%, but this could be due to apache not understanding what to do with PHP files. In other words, Apache should let PHP engine handle the file processing, but instead of doing that, it just uploads the file contents and hence you are getting save or download file...etc

    Check your httpd.config, and make sure that the following line exist
    AddType application/x-httpd-php .php
    You should also make sure that the PHP module is loaded. Check if the following line exist, and whether it points to the correct path to where you have installed PHP or not.
    LoadModule php5_module "c:/php/php5apache.dll"
    I would also recommend using WAMP if you are using windows. It will install PHP, MySQL, SQLite, PhpMyAdmin, Apache2, SQLite Admin using a single installer. Plus, you can install PHP4 Addon so that you can switch between PHP4 and PHP5 when necessary.

    Cheers,
    Ess

  • #10
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ess View Post
    I am not sure 100%, but this could be due to apache not understanding what to do with PHP files. In other words, Apache should let PHP engine handle the file processing, but instead of doing that, it just uploads the file contents and hence you are getting save or download file...etc

    Check your httpd.config, and make sure that the following line exist


    You should also make sure that the PHP module is loaded. Check if the following line exist, and whether it points to the correct path to where you have installed PHP or not.


    I would also recommend using WAMP if you are using windows. It will install PHP, MySQL, SQLite, PhpMyAdmin, Apache2, SQLite Admin using a single installer. Plus, you can install PHP4 Addon so that you can switch between PHP4 and PHP5 when necessary.

    Cheers,
    Ess
    Hmm.. I have all of that in my httpd.conf file.

    Maybe AddType application/x-httpd-php .php line is not in the correct place? In the AddType lines does that line go at the end after AddType application/x-gzip .gz .tgz?

    Thanks to everyone for the help. I really appreciate it.

  • #11
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Yeah, they should be fine there. Check your logs for any errors from apache/php.

  • #12
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm still very new at this, how do you check you logs?

  • #13
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Look for a "logs" folder in the apache folder, and specifically the error_log in that folder.

  • #14
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    cool, thanks.

    Also if I use WAMP, do I have to re configure Apache, Mysql and PHP all over again? Or does it do that automatically?

  • #15
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Probably does most if not all of it automatically, but you might want to remove your current setup first to avoid confusion and conflicts between the two.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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