PHP 4.0 Bug #5674 Updated: Relative paths don't work
| From: | Bug Database | Date: | Thu, 31 Aug 2000 15:24:22 +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-31444@lists.php.net to get a copy of this message | ||
ID: 5674
Updated by: zak
Reported By: amour@centras.lt
Status: Assigned
Bug Type: Scripting Engine problem
Assigned To: zak
Comments:
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------
Full Bug description available at: http://bugs.php.net/?id=5674