php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10639 include() & require()
Submitted: 2001-05-03 13:08 UTC Modified: 2001-07-10 13:53 UTC
From: sb at bpm dot ch Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.4pl1 OS: AIX 4.3.3
Private report: No CVE-ID: None
 [2001-05-03 13:08 UTC] sb at bpm dot ch
On AIX 4.3.3(ML6) with PHP and Apache from IBM's Linux Toolbox the functions include() and require() don't work correctly. If these functions are used, a "page not found" error occures.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-04 15:33 UTC] sniper@php.net
Please add some short example scripts into this bug report.
Which explains what you're trying to do.

--Jani
 [2001-05-07 10:00 UTC] sb at bpm dot ch
Here is a sample script:

--- test.php --------------------
<?php
include("test.inc");
?>
---------------------------------

--- test.inc --------------------
<html>
<head>
<title>test</title>
</head>
<body>
<p>this is a test</p>
</body>
</html>
---------------------------------

Normaly you will see on http://www.mydomain.com/test.php the content of the file test.inc as standard HTML page. On your PHP implementation the page test.php will not be found.

Stephan

 [2001-05-10 05:00 UTC] sniper@php.net
Does it print out any errors? Is your error level
set to E_ALL in php.ini?

--Jani

 [2001-05-10 05:34 UTC] sb at bpm dot ch
The binaries from IBM does not contain a php.ini file. In phpinfo() there is no value set to E_ALL.
 [2001-05-10 05:37 UTC] sb at bpm dot ch
There is no php-error visible. My browser (IE 5.5) says that the page can not be found.
 [2001-05-10 05:44 UTC] sniper@php.net
So does that same script work if you comment out the 
include part? And add some echo "sometext" there?

--Jani

 [2001-05-10 05:53 UTC] sb at bpm dot ch
Yes.

-- Stephan
 [2001-05-10 06:00 UTC] sniper@php.net
Try this script:

<?php

echo "this is a test";

error_reporting(E_ALL);
include("test.inc");

?>


Any errors reported? In error_log maybe?

--Jani


 [2001-05-10 13:42 UTC] sb at bpm dot ch
Without the test.inc file i've got the following lines:
this is a test
Warning: Failed opening 'test.inc' for inclusion (include_path='.:/opt/freeware/lib/php') in /usr/opt/freeware/apache/share/htdocs/test.php on line 4

With the test.inc file i've got only the IE error, that this page is not available.

-- Stephan
 [2001-05-10 14:00 UTC] sb at bpm dot ch
In /var/opt/freeware/apache/logs/error_log i've found the following error:

[Thu May 10 19:41:41 2001] [notice] child pid 5444 exit signal Illegal instruction (4)

Every time when i try the test.php with the included file this error occurs.

-- Stephan

 [2001-05-10 14:17 UTC] sb at bpm dot ch
Just for information:

1.  I've updated AIX 4.3.3 now to the Maintenance-Level 8 (the latest one). But the problem is unchanged.

2.  I'm using the binary package: php-4.0.4pl1-1.aix4.3.ppc.rpm
    from: ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/php

--stephan
 [2001-07-09 08:36 UTC] jeroen@php.net
Could you submit the results when test.inc:

- is chmod a-r
- is chmod a+r ?

Apparently PHP crashes trying to open the file.

Try also, in stead of th include(), a 

$fp = fopen('test.inc');
echo fread($fp,filesize('test.inc'));
fclose($fp);

To see wether the problem is in the include() or simply in
opening of the file. This also with word-readable on/off.
 [2001-07-10 13:53 UTC] jeroen@php.net
Stephan emailed me:
> The problem is solved in Version 4.0.5 compiled with GCC.

So closing
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 04:01:28 2024 UTC