Jump to content

Help with realpath


Beuy

Recommended Posts

Good day,

 

I am trying to modify a open source third party PHP program to allow automatic logging in with an external script, however I am running into a problem with understanding how the realpath() function works.

 

The file init.php which is located in the include directory (directory structure is provided below) is trying to define EXT_PATH as the following:

 

define ("_EXT_PATH", realpath(dirname(__FILE__).'/..') );

 

I realized early that this would no longer work, so I started to test different statements including

 

define ("_EXT_PATH", realpath(dirname(__FILE__).'/..'/wamp/www/cobra/aps/files) );

 

And what feels like a million other combinations however I just can't get it to work! I continually get the following error:

 

Warning: require_once(_EXT_PATH/include/users.php) [function.require-once]:failed to open stream. No such file or directory in C:\wamp\www\cobra\aps\file\include\login.php on line 38

 

Fatal error: require_once() [function.require]: Failed opening required '_EXT_PATH/include/users.php' (include_path='.;C:\php5\pear') in C:\wamp\www\cobra\aps\files\include\login on line 38

 

My directory structure is as follows:

C:

-wamp

--www

---cobra

----aps

-----files

------include (init.php is located in this folder)

 

My automatic login script is being executed from the cobra directory and is including login.php (which is in the include folder of the files folder) however I have been informed that this shouldn't be causing any problems.

 

Any help regarding this problem would be greatly appreciated, and I apologise if I have provided too much detail here.

 

 

Link to comment
https://forums.phpfreaks.com/topic/109694-help-with-realpath/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.