Ok I hope I can explain this, as I am pretty confused myself.
I am reading the book ‘Build Your Own Database Driven Website Using PHP & MySQL’. I installed WAMP, then installed Apache, PHP & MySQL, seperately (like in the book). After using them for a little while I decided to unistall everything and just use WAMP. Since reinstalling WAMP (about 5 times) I still have acces denied to phpMyAdmin (attachment 1) and my localhost shows a page containing the words ‘It works!’ (attachment 2).
I’m hoping someone here can help me sort this out, as I said I’m a bit confused at what’s going on, and I’m fairly new to this.
UNinstall everything - specifically your individual daemons AND WAMP. Restart your computer (to clear the services). Reinstall. I’m not a fan of “canned programs” but WAMP should then reinstall everything.
The problem you’ve displayed is that you don’t have a root password in MySQL so PHPMyAdmin can’t function. Be sure you enter a password (for MySQL when asked.
The “It works” page is just there to show you that the apache server is up. You need to setup a virtual host to point to your site. I don’t know if WAMP comes with Webmin? But Webmin is really great for helping to administrate apache; however, I don’t want to confuse you, so if WAMP provides a way for you to change/add/delete new websites then you need to make the relevant changes there.
Yea it seems like everything is working but I guess the thing that is annoying me, is when I was using WAMP on it’s own the localhost was showing up WAMP’s homepage, with server configuration etc. Then (after a few months) I had installed Apache, MySQL & PHP just like in the book, and that way when running Apache it showed the ‘it works’ page.
As I said I’m kinda new to this, but what I am trying to achieve now is to have the WAMP homepage up instead of the ‘it works’ page (which I have no idea how to do).
Probably the easiest way is to navigate in the file manager to your WAMP directory (default is c:\wamp\www). Open you will see your site files and folders inside this directory. Copy these files and folders and then navigate to your www directory in the path that apaches public or www directory is in the “How to …” book. You may have to rewrite the permissions depending on what WAMP had mapped the files and folders and what permissions exist on your regular Apache install.
I’ve just created a sub folder (test-wamp) with an index.html file inside, in the wamp/www/ directory and that seems to work.
I’ve typed in localhost/test-wamp/ in the browser and my html file is showing up. So it looks like the directory is still wamp/www/ but I don’t know which file to edit to get rid of the ‘it works’ page and show the default index.php page which was there when I reinsalled WAMP.
[/COLOR][COLOR=#000000][FONT=georgia]or restart your computer.
BTW, you are not too annoying, SitePoint is a place for people to learn and share knowledge. You have some challenges that you are trying to sort out, you demonstrate that you are trying to troubleshoot the problem yourself. Feel free to ask more questions if we can be of service.
I looked in httpd.conf and the only code I found that looked like it needed to be changed was:
I changed it to - ServerRoot “c:/wamp/www/” and restarted, but it wouldn’t work (WAMP stayed in orange colour).
After a bit of messing around, I typed ‘localhost/index.php’ into the browser and it’s showing the WAMP homepage. So I think I’m happy enough with that, it’s all working, not exactly how I wanted it, but it’s working.
Thanks for your help Steve.
Also in the httpd.conf file I saw these, looks like all other directories are pointing to c:/wamp/www/
I run apache and mysql in Linux, so I am not that familiar with the WAMP configuration although a little more familiar with LAMP which is similar. When trying to help I search in google for WAMP a virtualhost configuration and most links I found seemed to refer to a section in the http.conf that contain at least one host directive; normally in Linux installs the virtual host and host directives are at the bottom of the conf. You are likely to find the directive that maps to the host there somewhere.
If you have not already done so, I would recommend that you restore the ServerRoot “c:/wamp/bin/apache/apache2.2.22” as this is mapping to the apache executable, without this if you reboot your machine you may find that WAMP doesn’t work at all as it won’t be able to find this executable to start.
I found this thread Creating Virtual Hosts on WAMP Server where the blog suggests that you will find the host configuration in C:\wamp\bin\apache\apache2.2.11\conf\extra and open the file “httpd-vhosts.conf". If this is true in your WAMP install then you will likely find the existing host directive there.
Yea I have changed the ServerRoot back to what it was. I looked in C:\wamp\bin\apache\apache2.2.22\conf\extra\httpd-vhost.conf and changed some of the code like it says in that link you gave me, but still ends up with the ‘It works’ html page.
Thanks for all your help, I’m sure if I was more knowledgable about this stuff, I would have sorted it a lot sooner.
Yes the conf file you attached is not causing the wrong route as these are both bogus virtual host settings. Can you trace in your WAMP’s http.conf where the virtual host or any host directives are located? Can you also open your tasks and then switch to the processes view and post a screen shot of the apache processes that are currently active? Can you also go into the admin interface of WAMP and select the http.conf their and scroll to the bottom of this file and copy any virtual host items that you can see?
Thanks for replying, I was away all weekend and couldn’t get to my PC. I have just started up WAMP and clicked localhost and now it’s on the WAMP server homepage. I haven’t changed anything since I was last on. (Not that I can recall anyway).
Did you restart the Apache service after your changed the php.ini file in the WAMP folder? The actions connected to your WAMP icon will restart the service after you make a change.
The other possibility is that you may be using another php.ini file because of your earlier install of Apache using the book’s method. If you create a php info page - WAMP may have one built in - you can check for the path that is being used for php. You will find this next to the ‘Loaded Configuration File’. You may need to create an info page to do this:
Only the php.ini file listed in your WAMP phpinfo() page, the other php.ini is not doing anything )other than confusing you ). The Apache configuration files define the path to what php.ini file is used at any given time.