Results 1 to 6 of 6

Thread: lamp won't run `.php` files was creating or editing on windows

  1. #1
    Join Date
    May 2013
    Beans
    19

    Exclamation lamp won't run `.php` files was creating or editing on windows

    Hi there

    When i create or edit some file like `index.php` with below simple content (on Windows) :

    Code:
    <?php
    echo 'Hello world';
    ?>
    Now, I want to run it on Ubuntu by lamp-server. Copied that `index.php` file on `~/public_html/`.
    Finally trying below in Browser :

    Code:
    localhost/index.php
    I get following error:
    Server error

    The website encountered an error while retrieving http://localhost/home.php. It may be down for maintenance or configured incorrectly.
    Here are some suggestions:




    HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
    But if i create that `index.php` on ubuntu with same content it works fine.

    It's some weird isn't it ?

  2. #2
    monkeybrain2012 is offline Grande Half-n-Half Cinnamon Ubuntu
    Join Date
    Oct 2012
    Beans
    874

    Re: lamp won't run `.php` files was creating or editing on windows

    index.php is in var/www

  3. #3
    Join Date
    May 2013
    Beans
    19

    Re: lamp won't run `.php` files was creating or editing on windows

    Quote Originally Posted by monkeybrain2012 View Post
    index.php is in var/www
    I have changed www folder to `~/public_html/`
    When i create `index.php` file in Ubuntu and put that in `~/public_html/` it works fine.

  4. #4
    Join Date
    Jul 2007
    Location
    Tāmaki Makau-rau, NZ
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: lamp won't run `.php` files was creating or editing on windows

    Thread moved to Server Platforms.
    BACKUPS are unsexy — until you discover you should have done one yesterday.
    Spare your nerves and do one before you upgrade or install.

  5. #5
    Join Date
    May 2013
    Beans
    19

    Re: lamp won't run `.php` files was creating or editing on windows

    I find out the problem

    Answer :
    Code:
    sudo chmod -R 755 ~/public_html

  6. #6
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: lamp won't run `.php` files was creating or editing on windows

    You didn't say what Web server you were using, but I'm assuming it's Apache (cuz of LAMP). Checking error logs helps tremendously.

    Glad you got it sorted.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

Tags for this Thread

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
  •