Installing PHP on windows 7

Associate
Joined
17 Dec 2007
Posts
652
Location
Edinburgh
Hi guys

getting really desperate here, got coursework due in on Thursday which involves MySql databases
What I to do is create a website which will provide a front end to my database using HTML and PHP

I'm pretty sure my HTML and PHP files are correct, how-ever every time I try and do something which involves running the PHP file, all that happens is that it tries to download the PHP file

The same things happens when I try and run the sample files we have been provided with

I have been told this is down to the fact that PHP isn't installed on my laptop

I have followed some of the guides online for installing PHP on windows 7 to no avail, still got the same problem

Getting really desperate now:(

Any advice would be greatly appreciated
Grant (Wingnuttzz)
 
Another vote for WAMP here. I'm using it on Windows 7 to develop and test. Works perfectly and was easy to install, doesn't interfere with anything else on my system.
 
If you get really stuck just get a cheap hosting package and use that as if it was a live site...couple of pounds and you're away.

I'd recommend tsohost.
 
Could also try XAMPP Lite which doesn't install anything, you can even run it from a memory stick.
 
Appears to be working using WAMP, thanks

Just got a new host of problems though, biggest problem is working with mysql now :(
 
Last edited:
Most of my work was done on the Linux machines in the University labs, but obiviously this is no good for working from home.

I can access all my data on the uni machines using a program called winSCP, and i can access/run the mysql database using another program called Putty.

Obiviously i can't do that to try and tie my database in with my website (using PHP). So i've tried using the address (linux23.macs.**.**.uk) which i would normally use to log in, but that doesn't work.

So i've tried opening my database using the mySQL consoel though WAMP, everytime. But everytime try to open my database through the console just gives me an error of "error 2" or "error 22". A quick google didn't give my avail.

Hope that makes some sort of sense

Kinda feel at a lose hope at the moment, as the PHP on the lab machines wasn't even working today:(
 
Hmm that doesn't sound too good. Can you list the comments you're using to load the database? (take a screenshot if there's a lot).

You might find it easier to install phpMyAdmin and load your database in through this instead.
 
On the Linux machines, we would use

"mysql -u gf46 -D gf46 -h mysql-server-1 -vp"

to log into MySql using the terminal.

It would then ask for a password and you would be logged in.

Then i'd give it the source of the database and it would create it

"source ~gf46/FarmerSubsidy/CreateFarmerSubsidyTables.sql"

And thats fine. When using Putty, I give it the "linux23.mac.**.**.uk" (commented out because i doubt its the best thing to post on the internet), log in with my username and password, and then give it the source of the data on the linux machine (i.e, same as above) and it will create it fine etc.

On my own PC with WAMP installed, i've tried both of these source lines using the mySQL console

"source ~C:/wamp/www/MySqlFarmerSubsidy/CreateFarmerSubsidyTables.sql"

"source ~Wingnuttzz/Documents/University Work/Year 1/Semester 2/DataBase Systems/Coursework - Farmers/CreateFarmerSubsidyTables.sql"

So i've tried it in my normal documents folder, and also in WAMP's own folder (although this is only for PHP stuff i'm sure)

I think the way i'm trying is ok but would be more than happy to be told otherwise
 
Last edited:
An alternative to phpMyAdmin which is quicker to get up and running are MySQL Administrator / MySQL Query Browser. Use the Administrator to create your user accounts / databases then the Query Browser to test out queries.

This should let you load your SQL file:
mysql -u USERNAME-p DBNAME < "C:\wamp\www\MySqlFarmerSubsidy\CreateFarmerSubsidyTables.sql"

You need to provide it with your MySQL username (which I assume it set-up initially in Wamp, or use the Administrator above to create a new one) and your database name.
 
XAMPP lite is very good, configures everything and sets up Apache, PHP, MySql and phpmyadmin automatically. I've got it working perfectly on Win 7 x64.
 
Thanks for your help, it is very much appreciated!

I've installed the MySQL package, but whenever I try to use the Administrator to create an account etc I just get an error...

As for opening the SQL file, will the database name just be the name of the file - so "CreateFarmerSubsidyTables".

With-in the CreateFarmerSubsidyTables file is just the creation of the database, so it Drops the Tables and then Creates them

Sorry for my lack of knowledge, but our lecture hasn't been very good, and his notes are vague to put it polietly
 
What error does it give?

If the database is created from within the script itsself then you might be able to use:
mysql -u USERNAME-p < "C:\wamp\www\MySqlFarmerSubsidy\CreateFarmerSubsid yTables.sql"
 
errror given is

"Could no connect to the specified instance.

MySQL Error Number 2013
Lost connection to MySQL server during query

If you want to check the network connection, please click the ping button."

Click the ping button and get a Request timed out error.

I know this means that it isn't able to make a connection, but i'm just using the same serverhost and port that i use in winSCP and putty...
 
WinSCP and Putty are for connecting to another computer. You need to connect to your own MySQL server on your computer- you should be connecting to host 127.0.0.1 aka localhost and using the MySQL username and password for that (the username is probably root).
 
ahh, my mistake.

I've managed to log in using host 127.0.0.1 and username root (no password), it gave me an error but it still opens the administrator and it says mysql server is running

under the query broswer, after dumping my database in that it just gives me constant errors.

Going to down to the uni labs tomorrow and hope to god that the PHP works there, and take it from there.
At least i know my working enviroment there, with the likes of WAMP, XAMPP etc, i'm a bit clueless to be honest. Probably not helping anything

Thanks again for your help
 
Back
Top Bottom