Hi all,
I've Apache & PHP installed on TCL. By default, there is index.html in /usr/local/apache2/htdocs. I've removed that file and replaced it with index.php. Code as below.
However, it seems like the Apache unable to process index.php automatically as seen in the screenshot below. Please advise.
tc@box:~$ df -h | grep apache
/dev/loop22 944.0K 944.0K 0 100% /tmp/tcloop/apache2
/dev/loop23 3.3M 3.3M 0 100% /tmp/tcloop/apache2-mod-php5
tc@box:~$
tc@box:~$ cd /usr/local/apache2/htdocs
tc@box:/usr/local/apache2/htdocs$ ls -lh
total 4
lrwxrwxrwx 1 root root 55 Apr 5 13:24 index.html -> /tmp/tcloop/apache2/usr/local/apache2/htdocs/index.html
-rw-r--r-- 1 tc staff 20 Apr 4 18:27 index.php
tc@box:/usr/local/apache2/htdocs$ rm -f index.html
tc@box:/usr/local/apache2/htdocs$ ls -lh
total 4
-rw-r--r-- 1 tc staff 20 Apr 4 18:27 index.php
tc@box:/usr/local/apache2/htdocs$
tc@box:/usr/local/apache2/htdocs$ lynx localhost
Index of /
Index of /
* index.php
tc@box:/usr/local/apache2/htdocs$ cat index.php
<?php
phpinfo();
?>
tc@box:/usr/local/apache2/htdocs$
This is another test
tc@box:/usr/local/apache2/htdocs$ cat index.html
<html>
<body>
This is HTML!
</body>
</html>
tc@box:/usr/local/apache2/htdocs$ cat index.php
<?php
echo 'This is PHP!';
?>
tc@box:/usr/local/apache2/htdocs$
index.php file is executed instead of index.php
tc@box:/usr/local/apache2/htdocs$ lynx localhost
This is HTML!
I'm able to execute index.php manually
tc@box:/usr/local/apache2/htdocs$ lynx localhost/index.php
This is PHP!
However, Apache still can't process index.php even though index.html has been removed.
tc@box:/usr/local/apache2/htdocs$ ls -lh
total 8
-rw-r--r-- 1 tc staff 44 Apr 5 13:54 index.html
-rw-r--r-- 1 tc staff 30 Apr 5 13:57 index.php
tc@box:/usr/local/apache2/htdocs$ rm -f index.html
tc@box:/usr/local/apache2/htdocs$ ls -lh
total 4
-rw-r--r-- 1 tc staff 30 Apr 5 13:57 index.php
tc@box:/usr/local/apache2/htdocs$ lynx localhost
Index of /
Index of /
* index.php