HTML/Apache/MySQL/PHP help...

Chris Davies

Chief PESsimist
Staff
14 May 2003
UK
Tranmere Rovers
Sorry guys, I know this isn't a technical website, but I'm really struggling here and I've been working on this for three days.

I've installed Apache, I've installed MySQL, I've installed PHP, I've installed Pear using the go-pear.bat program included with the PHP distribution, I've installed Smarty. I've used "pear install db" from the command-line to install the DB package.

I've edited the php.ini so that the "includes" directory includes the PEAR directory, and I've also edited it to uncomment the php_mysql.dll extension line.

Now I'm completely new to all of this, this is the first time I've ever done anything involving these programs. But I've followed an O'Reilly book (printed in 2006) and completed all of the instructions down to the last letter.

Whenever I try to use a command - not just PEAR commands but default commands too such as MySQL_connect() - I get an error. With PEAR's DB::connect (or anything else beginning with DB), the error returned is "extension not found", with MySQL_connect() the error is "call to undefined function" (how the hell can it be undefined, it's one of the basic bloody functions).

Please guys, seriously, I'm going to have a nervous breakdown.
 
Sorry guys, I know this isn't a technical website, but I'm really struggling here and I've been working on this for three days.

I've installed Apache, I've installed MySQL, I've installed PHP, I've installed Pear using the go-pear.bat program included with the PHP distribution, I've installed Smarty. I've used "pear install db" from the command-line to install the DB package.

I've edited the php.ini so that the "includes" directory includes the PEAR directory, and I've also edited it to uncomment the php_mysql.dll extension line.

Now I'm completely new to all of this, this is the first time I've ever done anything involving these programs. But I've followed an O'Reilly book (printed in 2006) and completed all of the instructions down to the last letter.

Whenever I try to use a command - not just PEAR commands but default commands too such as MySQL_connect() - I get an error. With PEAR's DB::connect (or anything else beginning with DB), the error returned is "extension not found", with MySQL_connect() the error is "call to undefined function" (how the hell can it be undefined, it's one of the basic bloody functions).

Please guys, seriously, I'm going to have a nervous breakdown.

sounds like your path is not set correctly... does the book mention setting your path?
 
  • Thread starter
  • Staff
  • #3
Yeah, it's all set. I've installed into the most basic directory possible as well, C:\php, to try and make everything as smooth as possible. Although I noticed that when I ran PEAR and tried to install the MDB2 package, files ended up in C:\php5. I can't see any reference to that directory anywhere, though.

I thought it was because I was using Vista, so I've just took three hours setting up on a Windows XP setup. Exactly the same problem.
 
Yeah, it's all set. I've installed into the most basic directory possible as well, C:\php, to try and make everything as smooth as possible. Although I noticed that when I ran PEAR and tried to install the MDB2 package, files ended up in C:\php5. I can't see any reference to that directory anywhere, though.

I thought it was because I was using Vista, so I've just took three hours setting up on a Windows XP setup. Exactly the same problem.

jack reply back with your results of this

Type these commands in a command window:MS-dos

echo %PATH%
echo %CLASSPATH%

If you get the message "echo is on" for either of these, then that particular variable has no value (it has not yet been set).
 
  • Thread starter
  • Staff
  • #5
Running "echo %PATH%" produces four directories, a Nokia one (my phone drivers), an Adobe Photoshop one, C:\Windows and C:\Windows\System32\Wbem.

Running "echo %CLASSPATH%" produces "%CLASSPATH%".

Cheers for your advice on this by the way, I appreciate it; this is driving me nuts. All I need to do is build a news creation page for a website, and so far I can't even get through the installation, hahaha. Even if I do get it working I don't know if I'll be able to build this page though. I've always been utterly crap with programming languages, I don't know why but I can read a textbook on PHP a million times and it just doesn't stick.
 
Running "echo %PATH%" produces four directories, a Nokia one (my phone drivers), an Adobe Photoshop one, C:\Windows and C:\Windows\System32\Wbem.

Running "echo %CLASSPATH%" produces "%CLASSPATH%".

Cheers for your advice on this by the way, I appreciate it; this is driving me nuts. All I need to do is build a news creation page for a website, and so far I can't even get through the installation, hahaha. Even if I do get it working I don't know if I'll be able to build this page though. I've always been utterly crap with programming languages, I don't know why but I can read a textbook on PHP a million times and it just doesn't stick.

mate it looks like your path is not set correctly. Can you re-read the part about your path in the book? And write back what the path should be.. according to the book
 
I'd suggest instead of installing each software on its own to just get xampp which has everything you need included. Much easier.
 
  • Thread starter
  • Staff
  • #8
I looked through the book again and where it mentions setting the path, it's all related to the php.ini or httpd.conf files in PHP and Apache respectively - nothing actually system-related. But in the end, by luck more than anything, I managed to get it sorted.

I installed an XP Virtual PC on this (Vista) machine and tried again - exact same error, but then I tried one of the 754 different solutions you find for the error on Google - copying two certain DLLs into the Windows\System32 directory - and it worked. I did the same thing on Vista and it still won't work, I noticed that every time you copy the files into the System32 directory and restarted the server, they would be moved to SysWow64 directory where they still can't be "picked up" by PHP. But it doesn't matter because I can do my work on the Virtual PC.

Bear in mind I'm completely new at all this and I'm probably going to run into a million more problems (please don't close the thread mods, I beg of you) - just so I know, if I get all of this working in Virtual PC and get the code written, once I hire a server to host it on, will I be able to upload everything and it will work? I realise there might be one or two directory names that need changing but apart from that?

Any particularly good places to hire a server from, by the way (including domain name)? Bearing in mind I'll need them to install Pear, if they haven't already, and I'll be stuffed if they won't.

Kel, I'd heard of Xampp, but I'm completely, 100% new to this, and so I have to follow the book word for word or I get lost. The book doesn't mention Xampp so I didn't want to get myself confused. If it's just a collection of packages though, then I might look at downloading it at some point. It's all so confusing... I can cope with HTML and CSS, even cross-browser compatibility, but this is just a nightmare for me...
 
I looked through the book again and where it mentions setting the path, it's all related to the php.ini or httpd.conf files in PHP and Apache respectively - nothing actually system-related. But in the end, by luck more than anything, I managed to get it sorted.

I installed an XP Virtual PC on this (Vista) machine and tried again - exact same error, but then I tried one of the 754 different solutions you find for the error on Google - copying two certain DLLs into the Windows\System32 directory - and it worked. I did the same thing on Vista and it still won't work, I noticed that every time you copy the files into the System32 directory and restarted the server, they would be moved to SysWow64 directory where they still can't be "picked up" by PHP. But it doesn't matter because I can do my work on the Virtual PC.

Bear in mind I'm completely new at all this and I'm probably going to run into a million more problems (please don't close the thread mods, I beg of you) - just so I know, if I get all of this working in Virtual PC and get the code written, once I hire a server to host it on, will I be able to upload everything and it will work? I realise there might be one or two directory names that need changing but apart from that?

Any particularly good places to hire a server from, by the way (including domain name)? Bearing in mind I'll need them to install Pear, if they haven't already, and I'll be stuffed if they won't.

Kel, I'd heard of Xampp, but I'm completely, 100% new to this, and so I have to follow the book word for word or I get lost. The book doesn't mention Xampp so I didn't want to get myself confused. If it's just a collection of packages though, then I might look at downloading it at some point. It's all so confusing... I can cope with HTML and CSS, even cross-browser compatibility, but this is just a nightmare for me...

HTML is platform independent, so it should work regardless of Virtual PC or Windows 2003 server. MySQL on the other hand....
Not so sure about it. Jack trust me, this might be frustrating but in the end it will only make you better at what your trying to acomplish, you will figure out something and the solution to your issue might come up again in another problem. Why not run your own server at your house?
 
Jack trust me, this might be frustrating but in the end it will only make you better at what your trying to acomplish, you will figure out something and the solution to your issue might come up again in another problem.
Yeah, I know. I wouldn't know HTML and CSS if it wasn't for trial and error (some of the "errors" lasting for like a week at a time). In-fact, the only reason I know anything about computers is because all I used to do was break them (not on purpose).

My brother-in-law, who's now pretty high up at IBM in the UK, used to say to me "the best way to learn about anything is to break it and then have to put it back together again", and that's how he (and I) have learnt everything PC-wise. Bear in mind I was ten when he first told me that, and having someone there to explain why deleting "win.exe" made the computer stop working was a big help. Anything I did to the computer he could show me how to fix. It's the only way stuff will stick in my mind.

Sorry, zzz. :)

Why not run your own server at your house?
For a start, the electricity bill in this house is so high, and the broadband bill is so high (and I'm living in rip-off Britain remember), that it would be a lot cheaper to pay for hosting elsewhere. I did think about that, I even set it up temporarily so that a friend could type in my IP address and view the site I'm working on (which was great for testing cross-platform actually, he even browsed the site using his Wii), but I've got that much electronics in this house that if I add anything else it will burst into flames.

Believe it or not (and this is really bad, I know, but there's no more plugs in the house), we currently have the following running off a single plug: a widescreen CRT TV, a DVD player, a video player, a PC, a monitor, a stereo, another PC, another monitor, a router, a powered USB hub, an external USB hard drive, a printer, an Xbox 360, a Wii, an original Xbox, a PlayStation2, a widescreen LCD TV and an air conditioner. That's 18 things. When something starts a fire, it's going to be one hell of a bloody fire, KABOOOM!

Thankfully, they're not all on at once, and I try to unplug everything when I'm not using it, but still. The electricity bill has literally tripled.
 
Last edited:
Believe it or not (and this is really bad, I know, but there's no more plugs in the house), we currently have the following running off a single plug: a widescreen CRT TV, a DVD player, a video player, a PC, a monitor, a stereo, another PC, another monitor, a router, a powered USB hub, an external USB hard drive, a printer, an Xbox 360, a Wii, an original Xbox, a PlayStation2, a widescreen LCD TV and an air conditioner. That's 18 things. When something starts a fire, it's going to be one hell of a bloody fire, KABOOOM!

Thankfully, they're not all on at once, and I try to unplug everything when I'm not using it, but still. The electricity bill has literally tripled.

So how many of those are on at once from that single plug socket?
 
As of now, two PCs and two monitors - the TVs, consoles etc. are all on standby.

I will eventually split the load between the plug they're all in now and another plug, but that will still be nine things each. We'll have to get an electrician in to fit some more plugs, I laugh at it but it's not funny. If there was ever a power surge... *Shudder*

The only reason it's still set up this way is because we actually have an electrician of sorts in the family (by "electrician" I mean "thinks he knows everything about everything, but usually he's right"). He said that the actual amount of electricity each thing needs is minor - it's nowhere near the full voltage that it will say on the plug, for anything, ever - and so it should actually be okay. He even plugged a power monitor into the wall, which you then plug everything in through, and the reading wasn't any more than he expected it to be. But he did say "your electricity bill is going to kill you, you're running the equivalent of 20 large lightbulbs non-stop 24 hours a day, 365 days a year". Or words to that effect.
 
Last edited:
I have just as many thing in my room, maybe more but I dont have everything plugged in at once.
I've got two sockets in my room, one has a basic 4 way extension thing, the other has one of these.
http://www.play.com/Electronics/Ele...rCenter-With-Monster-Clean-Power/Product.html
Thats used for my PC, Monitor, Modem, Router, TV, Stereo, Printer and External HDD which leaves 3 spare plug sockets on it (the 8 things I mentioned only take up 5 plugs, hard to explain how its done) that I use for my PS3, PS2, Wii, X360, N64, a N64 Backup device (yes it needs it own power supply), Gamecube and SNES. Seeing how I'm never gonna play all of them at the same time, having 3 spare between those consoles is more than enough.
The last 4 way extension is used for all my chargers like the Laptop, the Phone, PSP, NDS, iPod, Battery charger, etc.

You just need to organise yout plugs and only leave on what you need. Right now, I've only got my Laptop, Modem, Router and the External HDD running. Even my TV is off from the mains. And I dont have to touch the plugs, I just flick one switch and only what I need recieves any power. Its much easier to explain if I could show you.
 
I have one of those in the living room actually, so I know what you're talking about. Such a lot of money though when everything seems to be alright.

BACK ON-TOPIC! :mryellow:

Okay, bear in mind I'm so new to this that my knowledge is literally days old. I'm coming across so many stumbling blocks that I can see myself giving up soon, I don't think I'm intelligent enough to take all of this in. My current question is regarding the MySQL side of things, databases/tables.

Forgive me if it doesn't make much sense; I'm so confused. There may even be an easier way of doing it that I'm missing.

Say I'm making a car website, and I'm currently working on a news input page (newsinput.php), that connects to a database (cars) and a table (carinfo) for storing the input. It needs to be able to take the name of the car, the manufacturer and then the news itself. Now say that, because there are other pages that require the same information (to save things having to be inputted over and over), the manufacturer names already exist in another table (carmanufacturers) in the same database. Can the news input page display a listbox with those car manufacturers, and then store that information in the news input (carinfo) table?

To take it further, say that there's another table (carfeatures) that lists various features - leather interior, CD player, iPod connection etc. - and you need to be able to connect to these in the same way as above, but able to select multiple options rather than just one. Is that possible?

In short, can the data inputted into one table use information from a different table?
 
Last edited:
In short, can the data inputted into one table use information from a different table?
yes, you need to do whats called a join. Jack do you have mysql for dummies or a book like that. If you do it enough you will figure it out, but like i keep telling you, if you go to university you can take classes in this stuff, and then someone will pay you to do this and spend hours and hours on it...
 
I have O'Reilly's "Learning PHP and MySQL", published 2006. It's great but the jumps are a bit big, they say "this is a table, a taaable, T-A-B-L-E, you may have seen one before", and then the next line is "the code you now need to enter is <?php if $data_769(24) *&statement {entrypoint[prev]79} overflowcheck error then shoveupyourass>"...

There's not a lot of explanation in there after a certain point. I saw a few similar books but their titles have one thing but not the other, i.e. MySQL For Dummies or PHP For Complete Morons, and seeing as both are new to me I thought it would be better to get a book that teaches both at once. Although perhaps that's a step too far.

I know what you mean about Uni but, thing is, I don't want to do this for the rest of my life - it's giving me enough headaches after a week, never mind a lifetime. :) It would just be great to make a decent-looking website that will maybe, possibly, put my CV above a few other people's (I'm hoping for reactions like "wow, when he's been unemployed he's been working on this, that's great that he's constantly learning" - or at least that's what I'll tell them). But it's very, very hard for someone who hasn't done any programming before (excluding HTML and CSS, which isn't real programming ;)).

Thank you so much for your advice anyway, I'll look up "join" and get to work on it.
 
Well I learned everything I know about PHP/MySql from a book called 'Beginning PHP5, Apache, And MySQL Web Development'

The book was amazing. It had 2 parts, one was a Movie Review website, and the other was a Comic Book fan website, and through these projects it taught you everything from basic PHP, to creating database tables, to creating a CMS, online store, mailing list, bulletin board. You should give it a try, PHP and MySql are not nearly as difficult as you think.
 
I'll definitely try to get hold of that, sounds exactly like what I need.
 
Just out of interest, if I was to run my own server, how would I configure a domain name? I'd still have to pay for that, right?
 
Abhishek, could you clear out a few PMs? Tried to send you one the other day but got told your PM box was full. :)

It's about the book, having a bit of a problem with something.
 
Quick question... I'd really appreciate some help lads, trying to learn this stuff is doing my head in.

So I'm reading the book Abhishek recommended and it says if you draw up your database and you have data repetition, seperate the data into a seperate table. For example, if you were doing a games review site and you had a game table with an "id" field, a "game name" field and a "console" field, if a game was on multiple consoles, you would be entering the same game name over and over again just to specify a different console. So you should make a seperate console table with an "id" field and a "consolename" field, then a seperate linking table with the game ID (game_id) and console ID (console_id) fields. I'm right in thinking that, aren't I?

Well say I do that and then it comes to making a transaction file, how do I link everything up? Erm *struggles to explain and bangs head on desk* :(

How is the data added to the seperated table? Example; every time an entry is made in the game table's "id" column, it will need to be added to the seperated table's "game_id" column, so how do I do this?

I'm looking at the book and it doesn't explain in any kind of detail how it's done, and I can't figure it out. It's probably totally obvious but I'm fucking useless with programming languages.

Do you understand what I mean?

:cry:
 
Last edited:
Back
Top Bottom