Community
Participate
Working Groups
Build Identifier: v20100507 I have script that needs to run from root directory //htdocs. There is some line of code that says include_once 'includes/dboperations.php';. menaing it has to check file from root directory //htdocs. problem is when i try to debug the script using eclipse, it always asks me new folder. Can I run script from //hdocs folder, instead of creating new workspace and folder in eclipse. Reproducible: Always
I think you can use the menu: File->Open File... then choose the your php file under//htdocs,then run it
(In reply to comment #1) > I think you can use the menu: > File->Open File... > then choose the your php file under//htdocs,then run it Sir, The Moment you open eclipse, it asks for work space. For example <?php echo $_SERVER['SERVER_NAME']; echo "\n"; echo $_SERVER["DOCUMENT_ROOT"]; echo "\n"; echo $_SERVER["SCRIPT_FILENAME"]; ?> works fine if i run it directly from IE say //htdosc/test/testing.php localhost C:/xampp/htdocs C:/xampp/htdocs/test/testing.php but when I run it in eclipse, it throws me error PHP Notice: Undefined index: SERVER_NAME in C:\xampp\htdocs\test\test1\testing.php on line 2 PHP Stack trace: PHP 1. {main}() C:\xampp\htdocs\test\test1\testing.php:0
yes, you have to create a workspace if you want to use eclipse. and your code works fine for me,you should choose Run As->PHP Web Page.
Here is the description and answer for the similar problem: http://stackoverflow.com/questions/14543606/wamp-getting-undefined-index-on-serverserver-name As Zhao mentioned, using "Run As -> PHP Web Page" should do the job. Marking this one as fixed.
Closing