ID:               25194
 User updated by:  ri at kamp dot de
 Reported By:      ri at kamp dot de
-Status:           Feedback
+Status:           Open
 Bug Type:         Filesystem function related
 Operating System: Solaris 8
 PHP Version:      4CVS-2003-08-21 (stable)
 New Comment:

Yes it seems to be nfs related since includes on a local disk
(phpmyadmin) work well.


Previous Comments:
------------------------------------------------------------------------

[2003-08-21 19:04:01] [EMAIL PROTECTED]

Works fine under Linux..but I don't have any NFS mount to work with.
Can you check if this happens only with the NFS?


------------------------------------------------------------------------

[2003-08-21 11:00:31] ri at kamp dot de

Description:
------------
require cannot open a file in the same directory as the calling script
[like require('./includefile.php')]. All dirs in the path have
permission 755. OS is solaris 8, documentroot mounted as NFS,
include_path has "." within. In the case this happens also getcwd() or
passthru("/bin/pwd") gives no result but passthru("/bin/ls") list the
"current" dir.

The function expand_filepath in main/fopen_wrappers.c gets an empty
result when calling VCWD_GETCWD(cwd, MAXPATHLEN);

This may not be a php bug (maybe solaris8 or nfs) but occurs only
within php. As workaround I changed expand_filepath to:
------------------
        int cwd_pos;

        result = VCWD_GETCWD(cwd, MAXPATHLEN);  
        if (!result) {
                //cwd[0] = '\0';
                php_error_docref(NULL TSRMLS_CC, E_WARNING, 
                        "cwd not working for
%s",SG(request_info).path_translated);
                strlcpy(cwd, SG(request_info).path_translated,
sizeof(cwd));
                cwd_pos = strlen(cwd) - 1;

                /* Strip filename */
                while (!IS_SLASH(cwd[cwd_pos])
                                && (cwd_pos >= 0)) {
                        cwd[cwd_pos--] = 0;
                }
        }
------------------

I know this is no final solution but the scripts work thereafter. 

Reproduce code:
---------------
include_path = ".:/usr/local/lib/php"
documentroot = "/home/htdocs"
script is in /home/htdocs/ (documentroot)

<? require('./somefile.php'; ?>

or

<? require('somefile.php'; ?>

Actual result:
--------------
Fatal error: main(): Failed opening required './somefile.php'
(include_path='.:/usr/local/lib/php')


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=25194&edit=1

Reply via email to