PHP 4.0 Bug #5674 Updated: Relative paths don't work
| From: | zak@php.net | Date: | Wed, 13 Dec 2000 21:03:17 +0000 |
| Subject: | PHP 4.0 Bug #5674 Updated: Relative paths don't work | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-41218@lists.php.net to get a copy of this message | ||
ID: 5674
Updated by: zak
Reported By: amour@centras.lt
Old-Status: Assigned
Status: Closed
Bug Type: Scripting Engine problem
Assigned To: zak
Comments:
User reports that bug disappeared several versions ago.
Previous Comments:
---------------------------------------------------------------------------
[2000-08-31 11:32:12] zak@php.net
Another Update from cynic:
Update: relative paths work on php4-200008310545 with
apache-1.3_20000831101201. It's clear the problem was
with the cut-down readdir.h. However, PHP still fails
to build unless one comments out the definition of
mode_t in %apachedir%/src/os/win32/os.h. Also, the
abovementioned snapshot reports itself as 4.0.2 (no
-dev suffix).
---------------------------------------------------------------------------
[2000-08-31 11:24:22] zak@php.net
More information from cynic@mail.cz
Hi. I found out relative paths work with 4.0.2 DSO on Apache
1.3.12. And though I don't know the mechanism behind it, I
found what has probably made the difference.
As of 4 months ago win32 DSO PHP4 stopped building. The hack
I was told to use was to delete everything but #include calls
from <apache>/src/os/win32/readdir.h before building PHP.
The original readdir.h from the 1.3.12 source looks like this:
/*
* Structures and types used to implement opendir/readdir/closedir
* on Windows 95/NT.
*/
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#ifndef API_EXPORT
# define API_EXPORT(type) __declspec(dllexport) type __stdcall
#endif
/* struct dirent - same as Unix */
struct dirent {
long d_ino; /* inode (always 1 in WIN32) */
off_t d_off; /* offset to this dirent */
unsigned short d_reclen; /* length of d_name */
char d_name[_MAX_FNAME+1]; /* filename (null terminated) */
};
/* typedef DIR - not the same as Unix */
typedef struct {
long handle; /* _findfirst/_findnext handle */
short offset; /* offset into directory */
short finished; /* 1 if there are not more files */
struct _finddata_t fileinfo; /* from _findfirst/_findnext */
char *dir; /* the dir we are reading */
struct dirent dent; /* the dirent to return */
} DIR;
/* Function prototypes */
API_EXPORT(DIR *) opendir(const char *);
API_EXPORT(struct dirent *) readdir(DIR *);
API_EXPORT(int) closedir(DIR *);
which I trimmed to this:
/*
* Structures and types used to implement opendir/readdir/closedir
* on Windows 95/NT.
*/
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
With this readdir.h, relative paths work in 4.0.2 DSO.
In the post 1.3.12 snapshot I tried (apache-1_3_20000825161201),
readdir.h changed:
/*
* Structures and types used to implement opendir/readdir/closedir
* on Windows 95/NT.
*/
#ifndef APACHE_READDIR_H
#define APACHE_READDIR_H
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#ifndef API_EXPORT
# define API_EXPORT(type) __declspec(dllexport) type __stdcall
#endif
/* struct dirent - same as Unix */
struct dirent {
long d_ino; /* inode (always 1 in WIN32) */
off_t d_off; /* offset to this dirent */
unsigned short d_reclen; /* length of d_name */
char d_name[_MAX_FNAME+1]; /* filename (null terminated) */
};
/* typedef DIR - not the same as Unix */
typedef struct {
long handle; /* _findfirst/_findnext handle */
short offset; /* offset into directory */
short finished; /* 1 if there are not more files */
struct _finddata_t fileinfo; /* from _findfirst/_findnext */
char *dir; /* the dir we are reading */
struct dirent dent; /* the dirent to return */
} DIR;
/* Function prototypes */
API_EXPORT(DIR *) opendir(const char *);
API_EXPORT(struct dirent *) readdir(DIR *);
API_EXPORT(int) closedir(DIR *);
#endif /* ndef APACHE_READDIR_H */
I cut this down to what's below, and relative paths didn't work
anymore. I'm no C programmer, so this is probably all the help
I can provide. Well, I can compile and test more snapshots if
needed.
/*
* Structures and types used to implement opendir/readdir/closedir
* on Windows 95/NT.
*/
#ifndef APACHE_READDIR_H
#define APACHE_READDIR_H
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#endif /* ndef APACHE_READDIR_H */
As for compile-time errors, both builds yielded just the usual
bunch of benign macro redefinitions and maybe some signed/unsigned
int comparisions.
At 09:19 AM 8/30/00 -0600, Zak Greant wrote the following:
--------------------------------------------------------------
>At 03:05 PM 8/30/00 +0200, you wrote:
>>4.0.2 and latest CVS (php4-200008300445) on NT4 SP5 with
>>apache-1_3_20000825161201 still affected. Should I try it
>>with 1.3.12?
>
>Hi Cynic,
>
>If you have time, that would be great! :) I anticipate that you will get exactly the same
>results.
>
>- Zak
>
------end of quote------
---------------------------------------------------------------------------
[2000-08-29 14:23:21] zak@php.net
Note from cynic@mail.cz:
"This bug seems to come and go. Relative paths worked for
me with a two weeks old snapshot, and stopped working
a week ago. It still doesn't work with php4-200008290145,
unchanged php.ini-optimized. (Win32 Apache module with
apache-1_3_20000825161201 snapshot.)"
---------------------------------------------------------------------------
[2000-08-06 00:10:27] zak@php.net
Please send me a copy of your php.ini file.
(zak@php.net)
---------------------------------------------------------------------------
[2000-07-26 22:31:24] zak@php.net
Will analyze...
---------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view the rest of the comments,
please view the bug report online.
Full Bug description available at: http://bugs.php.net/?id=5674