Results 1 to 10 of 13

Thread: during install cant find test.php

Hybrid View

  1. #1
    Join Date
    Jan 2012
    Beans
    248

    during install cant find test.php

    Hi all

    I have been installing Apache, php and mysql on my machine from instructions:
    https://help.ubuntu.com/community/ApacheMySQLPHP
    I have successfully setup Apache and have installed php. The instructions state that:
    Checking PHP 5 installation
    In /var/www , create a text file called "test.php", grant the world (or, at least, Ubuntu user "apache") permission to read it, write in it the only line: "<?php phpinfo(); ?>" (without the quotation marks) then, with your web browser, go to the URI "http://localhost/test.php": if you can see a description of PHP5 configuration, it proves PHP 5 works with Apache.
    So I created test.php in my /var/www directory and chmod the file:
    Code:
    glenn@acer:/var/www$ ls -al
    total 16
    drwxr-xr-x  2  root     root       4096 May 19 21:14 .
    drwxr-xr-x 14 root     root       4096 May 19 20:52 ..
    -rw-r--r--      1  root      root      177 May 19 20:52 index.html
    -rw-r--r--      1  www-data www-data   20 May 19 21:14 test.php
    -rw-r--r--      1  root     root        0 May 19 21:14 test.php~
    glenn@acer:/var/www$
    but when I goto http://localhost.test.php it gives me a 404 not found error.

    Any suggestions?

  2. #2
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: during install cant find test.php

    You've typed the wrong URL. It should be:
    http://localhost/test.php
    Cheesemill

  3. #3
    Join Date
    Jan 2012
    Beans
    248

    Re: during install cant find test.php

    Quote Originally Posted by Cheesemill View Post
    You've typed the wrong URL. It should be:
    http://localhost/test.php
    OOps...But still did not fix the problem. Still have a 404 error.

  4. #4
    Join Date
    Oct 2011
    Location
    Turkey - Istanbul
    Beans
    23

    Re: during install cant find test.php

    follow the images and save you IP number:



    now open your firefox, write your ip and your file name,E.X: 192.168.1.4/test.php , did that worked?
    thanks

  5. #5
    Join Date
    Jan 2012
    Beans
    248

    Re: during install cant find test.php

    My arabic is a bit rusty....

    http://192.168.1.65/test.php

    Yeah Nah didn't work. Apache is set up as localhost so should work as http://localhost/test.php

    Installing PHP 5

    To only install PHP5. use any method to install the package

    libapache2-mod-php5Enable this module by doing
    sudo a2enmod php5which creates a symbolic link /etc/apache2/mods-enabled/php5 pointing to /etc/apache2/mods-availble/php5 .
    Except if you use deprecated PHP code beginning only by "<?" instead of "<?php" (which is highly inadvisable), open, as root, the file /etc/php5/apache2/php.ini , look for the line "short_open_tag = On", change it to "short_open_tag = Off" (not including the quotation marks) and add a line of comment (beginning by a semi-colon) giving the reason, the author and the date of this change. This way, if you later want some XML or XHTML file to be served as PHP, the "<?xml" tag will be ignored by PHP instead of being seen as a PHP code mistake.
    Relaunch Apache 2 by
    sudo service apache2 restart
    Checking PHP 5 installation

    In /var/www , create a text file called "test.php", grant the world (or, at least, Ubuntu user "apache") permission to read it, write in it the only line: "<?php phpinfo(); ?>" (without the quotation marks) then, with your web browser, go to the URI "http://localhost/test.php": if you can see a description of PHP5 configuration, it proves PHP 5 works with Apache.
    Last edited by Senior_Buckethead; May 20th, 2012 at 12:49 AM. Reason: MORE INFORMATION

  6. #6
    Join Date
    Oct 2011
    Location
    Turkey - Istanbul
    Beans
    23

    Re: during install cant find test.php

    open terminal and write:
    sudo apt-get install mysql-server mysql-client apache2 php5 libapache2-mod-php5 php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl phpmyadmin

    /etc/init.d/apache2 restart



    big things but it is better then nothing now do it agian and write your ip in your firefox, e.g 192.168.1.4 will something like that appear to you:

    thx

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
  •