| Summary: | Running script from root directory in eclipse | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | RISHI <kaprishi1> |
| Component: | PDT | Assignee: | PHP Debug <php.debug-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | bartlomiej.l, silviya |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
RISHI
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 |