I'm working with an existing PHP web application. It's running fine on the remote Linux server but I can't run it on WAMP server, Windows 7 on my local computer. The problem is the previous developer's used absolute path all over the code. for example one of them is:
require '/disk2/html/src/web_tool/db_connect.php';
my localhost folder is F:\wamp\www
and I have the same structure:
F:\wamp\www\myProject\disk2\html\src\web_tool\db_connect.php
But it can't find the db_connect.php. I can't change the path because it's a big project and if I want to, I have to find and change more than 400 line of code. I'm not sure what the problem is and how to make it work. Any suggestion is highly appreciated.
EDIT: I ran a simple test on my WAMP Server. I created this file structure:
F:\wamp\www\test\myfolder\index.php
with this code:
require '/myinc.php';
and F:\wamp\www\test\myinc.php
with this code:
echo 'It works!';
I get this warning:
Warning: require(/myinc.php): failed to open stream: No such file or directory in F:\wamp\www\test\myfolder\index.php on line 2
and this error:
Fatal error: require(): Failed opening required '/myinc.php' (include_path='.;C:\php\pear') in F:\wamp\www\test\myfolder\index.php on line 2
I don't have such a folder as C:\php\pear on my disk.
The WAMP server is just installed, haven't touched anything in the php.ini or other config files. the version is:
WAMP SERVER 64bit version 2.5 including:
Apache : 2.4.9 MySQL : 5.6.17 PHP : 5.5.12 PHPMyAdmin : 4.1.14 SqlBuddy : 1.3.3 XDebug : 2.2.5