Hi, I hope this is the write forum. I have created a site on my local WAMP server and tried to open the php page so I can edit it in real time. Got the following warnings. ( ! ) Warning: constant() [<a href='function.constant'>function.constant</a>]: Couldn't find constant PHP_DIR in C:\wamp\www\site\mytpl\index.php on line 10 ( ! ) Warning: chdir() [<a href='function.chdir'>function.chdir</a>]: Invalid argument (errno 22) in C:\wamp\www\site\mytpl\index.php on line 10 this is what is written on line 10 in the php code chdir(constant("PHP_DIR")) or die("Fatal Runtime Error.");?> Can someone guide me in the correct direction ? WAMP icon is GREEN and running fine.phpmyadmin also ran fine
Your server is working fine that isn't the problem. Post all of the code from index.php and any other files which are being included for me to be able to help more.
Hi, Thanks for the help. Its actually a PTC script ( Clix Script from Incentive scripts ) , and there are a lot of files but I will copy here the index.html for now. http://pastebin.com/wvuUY6bn As I see its using some masterpage or iframe kind of concept to read in other files as header, footer and nav and these 3 files are in another folder than this index file, does it changes directories for this ? Thanks for any help.
Hi there, If you said that the file was provide with a bunch of other scripts there probable PHP_DIR constant should be defined in some other PHP file. Look for filenames like config.php, globals.php, settings.php etc.. And here you should probable set PHP_DIR . Also, looking at the code on that link looks like you will need to put some include() or required() to load some other files, unless your file is not wrapped by some other main PHP script. BR, Marcel
To remove the error would be simple just add after line 9 (the comments) define('PHP_DIR', getcwd()); PHP: As you haven't supplied me with the other classes and methods there's not really much that I can do. Please post the other classes and then I can help some more.