Hello!
I am a rookie in PHP and have just started learning this technology a couple of days ago.
I have created As one of my first exercises, I have created a PHP website project in Dreamweaver CS6 which contains two pages, index.html and Awards.php. The index.html page is a simple html page which contains a simple <a href> link to Awards.php However when I run the index.html page (by clicking on "P. review in IExplore"), I don't see the link to the Awards.php page. Instead I see a page with the text, "It works!" in <h1> size heading. My PHP web project only contains these two pages (index.html and Awards.php) and I haven't created any such HTML page with the "It works!" message in my project.
Can anyone please tell me why exactly is this happening? Replies at the earliest will be highly appreciated. Thank you in advance.
index.html Does Not Open!
Moderator: General Moderators
Re: index.html Does Not Open!
That's the default Apache index.html. Sounds like your documents are outside of the document root and/or you have not correctly configured your virtual host.
Re: index.html Does Not Open!
I'd suggested that since it's a link attribute, it should work without the Apache server. So just try to open the file from its original folder (for example, desktop), if you see the link then your work is fine, otherwise I'd check the link tag to make sure the syntax is correct
Code: Select all
<a href=""></a>Re: index.html Does Not Open!
Thank you very much for replying.Celauran wrote:That's the default Apache index.html. Sounds like your documents are outside of the document root and/or you have not correctly configured your virtual host.
Could you exactly tell me what do you mean by "documents are outside of the document root"? I have created a PHP website project using Dreamweaver CS6 and have placed the documents on my local hard drive (C:\Users\<My username>\Documents\Dreamweaver CS6\<My Project name>) folder using this IDE. As far as I know, I don't think the problem exists with my virtual server host as I have installed XAMPP, created demo PHP projects using Aptana Studio 3 IDE, tested and run them successfully using Apache server and have got the desired output in the browser.
Re: index.html Does Not Open!
Celauran means that your "It Works!" page is coming up because Apache's document root is set to look in a different directory. I'm not familar with XAMPP or window's default setups, but I would guess you might find the document root in something like c:\xampp\htdocs where you'll find the "It Works!" example page.
You have two choices, move your files to this location.
Or reconfigure Apache to point to your desired directory. I think in windows you can find the httpd configuration file in
c:\XAMPP\apache\conf\httpd.conf
In there you'll see something like
[text] DocumentRoot C:/xampp/htdocs/
<Directory />
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>[/text]
Change the DocumentRoot location to your desired spot and RESTART apache.
You have two choices, move your files to this location.
Or reconfigure Apache to point to your desired directory. I think in windows you can find the httpd configuration file in
c:\XAMPP\apache\conf\httpd.conf
In there you'll see something like
[text] DocumentRoot C:/xampp/htdocs/
<Directory />
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>[/text]
Change the DocumentRoot location to your desired spot and RESTART apache.
Re: index.html Does Not Open!
Bingo!Eric! wrote:Celauran means that your "It Works!" page is coming up because Apache's document root is set to look in a different directory. I'm not familar with XAMPP or window's default setups, but I would guess you might find the document root in something like c:\xampp\htdocs where you'll find the "It Works!" example page.
You have two choices, move your files to this location.
Or reconfigure Apache to point to your desired directory. I think in windows you can find the httpd configuration file in
c:\XAMPP\apache\conf\httpd.conf
In there you'll see something like
[text] DocumentRoot C:/xampp/htdocs/
<Directory />
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>[/text]
Change the DocumentRoot location to your desired spot and RESTART apache.
The problem was that since I am a rookie in PHP, I was referring to online tutorials that taught how to create PHP website projects by installing other packages (WAMP/MAMP/...) and/or a different server (IIS/Tomcat) and/or other IDE (NetBeans/Eclipse/Aptana Studio/...) and/or OSs (Linux/Mac) whereas I had installed XAMPP for my Windows 8 machine, as mentioned in my first post. Just can't thank all of you enough for your help. You guys are great! Cheers.
I also wish to add something for other rookie PHP developers, who will visit this forum for help when they face a similar problem, and have the same configuration environment installed on their machines (Windows OS, XAMPP, Apache and Dreamviewer CS6). For an environment as similar as mine, I recommend you to follow this series of tutorials: http://www.adobe.com/devnet/dreamweaver ... p_php.html