Localhost/phpTutorials/index.php 'Not Found' on this server.

Sorry. I will be posting a handful of newbie questions. I hope someone can follow me.
Today, I am beginning to use the tutorials on this site and I already feel I should have started here.

I have already gone thru about 75 tutorials from another site and got stuck.
Learned a lot though I feel like I am missing the very basic concept of the file structures and paths required in php.
I enabled and installed apache, phpMyAdmin and mySql.

I truly think that my problems involve FILE STRUCTURE and PATHS.

I typed in this code exactly- right off the beginner tutorials on this site.

$browser = $_SERVER[“HTTP_USER_AGENT”];

You are using the <?php echo($browser);?> web browser.


Using Netbeans IDE.
[php]Browser output:

‘Not Found’
The requested URL /phpTutorials/index.php was not found on this server.[/php]

[php]Netbeans> new project>
Pop up box with configurations.

Project folder: /Users/my name/NetbeansProjects/phpTutorials
Source folder: /Users/my name/NetbeansProjects/phpTutorials
Web Root:

Run Configuration.
Run as: Local Web Site (running on local web server)
Project URL: http://localhost/phpTutorials
Index file: index.php[/php]

NOTE: above you see NetbeansProjects in the path.
For other php projects, I actually had to create the folder from the Mac Finder for instance phpProject1.
I was unable to navigate from inside of these configuration setups in Netbeans thus using this method, the NetbeansProject folder is in the PATH.

I do not know if these PATHS have something to with the inability to create the names.txt file with fopen( ).


Further Notes.
DocumentRoot /Library/WebServer/Documents

URL: /localhost/
Browser output: ‘It works’

URL: /localhost/~my name
Browser output: ‘My Site Works’

if you’re unsure of the starting path, you can use $_SERVER[‘PHP_SELF’], it’ll do the relative url for you. If your project and source project paths are right (don’t think they are), then it’ll work.

Sponsor our Newsletter | Privacy Policy | Terms of Service