Jump to content
  • Advertisement
Sign in to follow this  
SyncViews

PHP cant see directory?

This topic is 2612 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I thought Id do some webstuff, make a highscore system, perhaps some update thing, however I am having issue with directories. The origenal problem was I wanted the directory containing the PHP file as the working directory, not the PHP installation directory (using with FastCGI on IIS), however it seems I cant see the webroot directory at all???

[source]
<?php
//script E:\Projects\Site\test.php
//chdir(dirname(__FILE__));//fails
//chdir('E:\\Projects\\Site\\'); //fails
echo file_exists('E:\\Projects\\Site') . '<br/>'; //false
echo file_exists('E:\\Projects') . '<br/>'; //true
echo file_exists('E:\\Projects\\Site\\Downloads') . '<br/>';//true
?>
[/source]

How is that even possible?

Share this post


Link to post
Share on other sites
Advertisement
Both have an index.php (relevance?).

Downloads inherits the Site folder privledeges (except CREATOR OWNER, but there set the same anyway), Site has:
IUSR: transverse/execute, list/read data, read attributes, read extended attributes, read
IIS_IUSRS: Same
SYSTEM, CREATOR OWNER, My Account, Administrators: All

Task manager has PHP as "DefaultAppPool" username, but I couldnt find any such thing?

Share this post


Link to post
Share on other sites
The next question would be does Site have an index.php. I was thinking maybe the function was trying to check for an index in the directories. As a test, have you set all 3 directories to 777? Don't assume inheritance. Sometimes files/folders attempt to keep their previous settings.

Share this post


Link to post
Share on other sites
Two things to look at...

There use to be a bug in php 5.3 (you didn't say what version you are running), under windows and this stackoverflow question which claims the parent directory needs read permissions.

Share this post


Link to post
Share on other sites

The next question would be does Site have an index.php. I was thinking maybe the function was trying to check for an index in the directories. As a test, have you set all 3 directories to 777? Don't assume inheritance. Sometimes files/folders attempt to keep their previous settings.


I said both have an index. When viewing somthing like say "Effective Permissions" on the files and directories in windows, there the same for all of them. I could try a 777 "all for everything" permission set I suppose, but I'm pretty much positive that is not needed.

It was a clean PHP install shortly before starting this topic, off http://windows.php.net/download/, so 5.3.8. I did not use any symlinks (i.e. E:\Projects\Site is the real folder, and the "Default Web Site" physical path is set to that).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!