|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13594 Symbolic Link
Submitted: 2001-10-07 23:52 UTC Modified: 2001-10-08 00:09 UTC
From: Ashwin dot Kutty at Dal dot Ca Assigned:
Status: Not a bug Package: *Directory/Filesystem functions
PHP Version: 4.0.6 OS: Linux 2.4.7-2
Private report: No CVE-ID: None
 [2001-10-07 23:52 UTC] Ashwin dot Kutty at Dal dot Ca
(Posted on PHP General User List)

On a default install of Redhat 8 I tried the following:-

I have a directory with an index.php script so that the url is something along the lines of .. Now following the
same logic I wanted to write another script but not bother creating another directory so I wrote my script called test.php and then created a symbolic link to it by pointing 'test' (without the quotes, of course) to test.php and upon going to I got my script's source displayed in plain text on the browser ..

Now maybe this is something I shouldnt be doing or the way I have the webserver configured but, just thought Id find out, by checking to see if anyone else knows anything about this..

BTW, I am on a Redhat 8 Linux (kernel version 2.4.7-2) server running php version 4.0.6 and I have checked in the conf of Apache (1.3.20) to see for the source its set to phps ..


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-08 00:09 UTC]
Your logic is based on the faulty assumption that is handled like a directory.  It's not, it's handled as a file with no associated mimetype.  So, it's treated with the default behavior by the webserver, which is typically to display its contents.  Basically, there's no reason for the web server to assume is a PHP script.  You can change that by using a ForceType directive in Apache.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 11:01:34 2024 UTC