Find the answer to your Linux question:
Results 1 to 3 of 3
I installed ubuntu 10.04, apache2, perl, MYSQL and PHP5. My test.pl script is working fine from /var/www directory. That is from browser if I type <http:>//<Server_IP_Address>/test.pl it works. Also test.pl ...
  1. #1
    Just Joined!
    Join Date
    Mar 2008
    Posts
    3

    [SOLVED] my browser tries to download the .php file instead of display it.

    I installed ubuntu 10.04, apache2, perl, MYSQL and PHP5.

    My test.pl script is working fine from /var/www directory. That is from browser if I type <http:>//<Server_IP_Address>/test.pl it works. Also test.pl runs from user home directory. If I runs from browser with <http:>//<Server_IP_Address>/~<User_Name>/test.pl it works perfectly.

    I made a soft link of /home/<User_name>/public.html to /var/www
    cd /var/www
    Then
    Ln –s /home/<User_name>/public.html <User_Name>

    My test.pl runs perfectly from browser if I type <http:>//<Server_IP_Address>/<User_Name>/test.pl

    Now I am facing problem with my PHP file.
    I have made a test.php script. And copy this file to /var/www and /home/<User_Name>/public_html.

    My test.php displays perfectly to my browser with a address
    <http:>//<Server_IP_Address>/test.php
    and
    <http:>//<Server_IP_Address>/<User_Name>/test.php.

    But when I type <http:>//<Server_IP_Address>/~<User_Name>/test.php to my browser address bar, my browser tries to download the file instead of display it.

    How do I solve this problem?

    Your help is highly appreciated.

    Thanks

  2. #2
    Linux Newbie JosePF's Avatar
    Join Date
    Jun 2010
    Posts
    225
    Hi,
    you should edit /etc/apache2/mods-enabled/php5.conf and comment lines:
    # <IfModule mod_userdir.c>
    # <Directory /home/*/public_html>
    # php_admin_value engine Off
    # </Directory>
    # </IfModule>

    Regards!
    There are people trying to avoid mistakes and another that tries to target.

  3. #3
    Just Joined!
    Join Date
    Mar 2008
    Posts
    3
    Hi JosePF
    Thanks a lot. I was just looking for this solution.
    Thanks a lot again.
    Aditi

Posting Permissions

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