This is a discussion on PHP can't open file with fopen under Windows Vista within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi, I have a problem with Apache/PHP under Windows Vista. I have been using the XAMPP package containing Apache ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
I have a problem with Apache/PHP under Windows Vista. I have been using the XAMPP package containing Apache and PHP for years on my local PC. I develop some of my internet pages in PHP to include some routine stuff, and afterwards run a PHP script which opens the PHP-files like a browser would do, i.e. fopen("http://localhost/myfile.php", "r"), and saves it as myfile.html. Then I publish the HTML-file. With Windows Vista this does not work. I can open PHP-files in my browser locally, and they open fine, with all the includes. I can even open files with fopen on the internet using my script. That works fine, too. But when I try to open the local file via http: on localhost, the script waits until the timeout comes. Apache does not answer. I have been trying for hours. - PHP is set to allow_url_fopen. - PHP is not running in safe mode. - I switched of the user access control (UAC) of Vista. No success. - I changed the user access rights to the local directory which hosts the files to full access for administrator, the current user, even for everybody. No success. - The files are located in the document root. No tricky subdirectory or redirect. - I did the tests as a normal user and as an adminstrator. And now, I'm running out of ideas what more I could try. Any suggestions? Thank you in advance. Rainer Klueting, Stuttgart |
|
|||
|
On Sat, 23 Jun 2007 22:27:19 +0200, Rainer Klueting
<rainer@klueting.de> wrote: >Hi, > >I have a problem with Apache/PHP under Windows Vista. I have been >using the XAMPP package containing Apache and PHP for years on my >local PC. I develop some of my internet pages in PHP to include some >routine stuff, and afterwards run a PHP script which opens the >PHP-files like a browser would do, i.e. >fopen("http://localhost/myfile.php", "r"), and saves it as >myfile.html. Then I publish the HTML-file. > >With Windows Vista this does not work. I can open PHP-files in my >browser locally, and they open fine, with all the includes. I can even >open files with fopen on the internet using my script. That works >fine, too. But when I try to open the local file via http: on >localhost, the script waits until the timeout comes. Apache does not >answer. > >I have been trying for hours. > >- PHP is set to allow_url_fopen. > >- PHP is not running in safe mode. > >- I switched of the user access control (UAC) of Vista. No success. > >- I changed the user access rights to the local directory which hosts >the files to full access for administrator, the current user, even for >everybody. No success. > >- The files are located in the document root. No tricky subdirectory >or redirect. > >- I did the tests as a normal user and as an adminstrator. > >And now, I'm running out of ideas what more I could try. > >Any suggestions? > >Thank you in advance. > >Rainer Klueting, Stuttgart Just a few: Any messages in the Apache access- and error logs? Any messages in the system event logs? Is the Apache service running? Something with MS Firewall going on? Any changes to your C:\WINDOWS\SYSTEM32\DRIVERS\etc\hosts file? Good luck! -- ( Kees ) c[_] All wiyht. Rho sritched mg kegtops awound? (#104) |
|
|||
|
Hi Kees,
there are no messages in access.log and error.log. The request doesn't seem to get through to Apache. That is my recent conclusion. In the system event log are some error messages, but none, which I can attribute in any way to my problem. I will have to analyse them further. Apache is now running as a process, but that doesn't seem to make any difference. The firewall is active. But that can't be the problem. A test script works, if I try to open a file on my website. It only does not work, if I try to open a file via localhost. I have not touched the hosts file. My Vista-notebook is only a few weeks old. I still have no idea where to look for the cause of the problem. Thank you for helping! Rainer Klueting, Stuttgart, Germany |
|
|||
|
Hi Kees,
I got it. A guy in a German Microsoft-Vista newsgroup found a bug report: http://bugs.php.net/bug.php?id=40287 The solution is, not to open the file via localhost, but 127.0.0.1. Thank you again! Rainer Klüting, Stuttgart, Germany |
|
|||
|
Have a look to the hosts-file in VISTA (windows/system32/drivers/etc/
hosts: 127.0.0.1 localhost ::1 localhost The last entry (seems to be an ip6-address) is the worse thing :) ... comment it: 127.0.0.1 localhost #::1 localhost and your "http://localhost/...." - requests will work. Have a nice day Wolfgang Kowalski |