Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: [SOLVED] Testing Local PHP files Using LAMP Server

  1. #11
    Join Date
    May 2008
    Location
    Birmingham, UK
    Beans
    283
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Testing Local PHP files Using LAMP Server

    Hav a look at https://help.ubuntu.com/community/ApacheMySQLPHP

    Does your browser ask if you want to download the php file instead of displaying it? If Apache is not actually parsing the php after you restarted it, install libapache2-mod-php4.[ED: I think this should be -php5 if you have php5 installed] It is installed when you install the php4 package, but may have been removed inadvertently by packages which need to run a different version of php.

    You may also need to actually enable it, by doing sudo a2enmod php4 [ED; ?php5]followed by sudo /etc/init.d/apache2 restart. If sudo a2enmod php4 [?5]returns "$ This module does not exist!", you should purge (not just remove) the libapache2-mod-php5 package and reinstall it.

    Be sure to clear your browser's cache before testing your site again.
    Last edited by cpetercarter; July 5th, 2008 at 08:31 PM. Reason: add note about php5

  2. #12
    Join Date
    Aug 2007
    Location
    127.0.0.1
    Beans
    1,800
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Testing Local PHP files Using LAMP Server

    Quote Originally Posted by brennydoogles View Post
    It seems we are getting somewhere, but still not where we need to be. I can now access files in /var/www/ through the browser, but instead of parsing them it gives me the option to download them. Here is a screenshot....
    Ok, your apache server doesn't know what to do with php.

    Code:
    sudo apt-get install libapache2-mod-php5
    Restart apache2, and test it again.
    "Just in terms of allocation of time resources, religion is not very efficient. There's a lot more I could be doing on a Sunday morning."
    -Bill Gates

  3. #13
    Join Date
    Mar 2007
    Location
    TN, US
    Beans
    607
    Distro
    Ubuntu

    Re: Testing Local PHP files Using LAMP Server

    Ok, using the help.ubuntu.com link really helped, now I can view most of my pages. Somethings are not working correctly, such as an AJAX news script I wrote (which works fine on my godaddy.com hosting), but I can work on that more later. Thanks for all of the help!!
    Registered Linux user 446122 , Registered Machine 352936.

  4. #14
    Join Date
    Jun 2006
    Location
    CT, USA
    Beans
    5,267
    Distro
    Ubuntu 6.10 Edgy

    Re: Testing Local PHP files Using LAMP Server

    I am curious why you picked such combination of tools, as a beginner? If starting with Python/Turbogears, and installing all by docs, you can have running webserver with database in less than hour. Of course, it will not be production-ready Apache, but developer's friendly CherryPy. Your database will not be MySQL but much simpler SQLite. But your "hello world" app will be generated for you, including install, in less than hour (including proper directory structure for future project, including JS and CSS files), and you can later change to MySQL - you just change config file. Same with Apache - but as beginner, you might be more interested in devel-friendly tools, not LAMP, which is optimized as effective production webserver.

    Just a thought about your priorities - you know better what they are.

  5. #15
    Join Date
    Mar 2007
    Location
    TN, US
    Beans
    607
    Distro
    Ubuntu

    Re: Testing Local PHP files Using LAMP Server

    Quote Originally Posted by pmasiar View Post
    I am curious why you picked such combination of tools, as a beginner? If starting with Python/Turbogears, and installing all by docs, you can have running webserver with database in less than hour. Of course, it will not be production-ready Apache, but developer's friendly CherryPy. Your database will not be MySQL but much simpler SQLite. But your "hello world" app will be generated for you, including install, in less than hour (including proper directory structure for future project, including JS and CSS files), and you can later change to MySQL - you just change config file. Same with Apache - but as beginner, you might be more interested in devel-friendly tools, not LAMP, which is optimized as effective production webserver.

    Just a thought about your priorities - you know better what they are.
    LOL... I understand what you mean. My idea to install a LAMP server was not thought out in advance at all... in fact, there was a php file that I did not want available on the web until it was finished, and I wanted to be able to test it without uploading it to my main server. It seems that I now have everything configured more or less properly (the problem with the AJAX was just a configuration issue caused by the change from my normal domain name to localhost). So while it was somewhat haphazardly that I decided upon LAMP, I now have it set up more or less to my liking and will keep it for now.
    Registered Linux user 446122 , Registered Machine 352936.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

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