I
believe the notation "./../" is illegal, perhaps either the new PHP or the new
Solaris is probably now enforcing that when the old did not?
I
would recommend dropping the leading "./" (since it just means "start from the
current directory" anyway), and trying it with just
"../extension.inc"
I
would also recommend not using .inc as a suffix, as anyone with half a brain
could view the source code by just typing in www.whatever.com/allmydatabasepasswords.inc or something similar, telling Apache to
deliver it as text. Following the practice of double-suffixing all include files
like so: "myphpcodefile.inc.php" will indicate that the file is an include file
while still forcing Apache to send the file through the php preprocessor before
displaying it, rendering the user unable to directly view the source code in
your include files.
(sorry for the double Jesse but I figured it would be
better to reply to the whole list rather than just to
you)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Paul Blondé
Web Programmer
enTel Communications Inc
250.633.5151
866.633.2644
-----Original Message-----
From: Jesse Santana [mailto:jsantana@xxxxxxxxx]
Sent: Friday, August 10, 2007 10:54 AM
To: php-install@xxxxxxxxxxxxx
Subject: PHP v4 vs. PHP v5 behavior
Maybe someone can shed some light on this problem for me. Our current production server is a Solaris 9 machine running Apache 1.3.37 and PHP 4.4.2. The following script works perfectly on this machine:
<?php
include("./../extension.inc");
echo "<BR>";
echo "Hello World!";
?>
The new server we are setting up is running Solaris 10, Apache 2.2.4 and PHP 5.2.3. The same script I mentioned above produces this error:
Warning: include(./../extension.inc) [function.include]: failed to open stream: Permission denied in /home/bu/jsantana/htdocs/php/IncludeExample.php on line 3
Warning: include() [function.include]: Failed opening './../extension.inc' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/bu/jsantana/htdocs/php/IncludeExample.php on line 3
Hello World!
If I define my include path as include("/home/bu/jsantana/htdocs/extension.inc");, the script works fine with PHP 5. Can anyone explain why under PHP 5 the ./../ does not back up one directory from the directory where I call my script from?
Thank you,
Jesse
Jesse Santana
Project Lead - Enterprise Services Group
Information Technology Services
California State University, Long Beach
1250 Bellflower Blvd.
Long Beach, CA 90840
Office: (562)985-8511
Fax: (562)985-8855
- References:
- PHP v4 vs. PHP v5 behavior
- From: Jesse Santana
- PHP v4 vs. PHP v5 behavior
- Prev by Date: PHP v4 vs. PHP v5 behavior
- Next by Date: RE: PHP v4 vs. PHP v5 behavior
- Previous by thread: PHP v4 vs. PHP v5 behavior
- Next by thread: RE: PHP v4 vs. PHP v5 behavior
- Index(es):