Troubles with PHP/MySQl in SuSE 9.1
Ok...here we go...I'm pretty new to the whole Linux-scene, not to mention PHP and MySQL.
This is the story: I followed this guide: http://www.coolsolutions.com/forums/...ic.php?p=10467 to install Apache2, PHP4 and MySQL on my SuSE box. The whole thing seems to be working as it's supposed to now, exept for one small problem: I can't seem to connect to a MySQL database. After the install, I made a page called info.php wich looks like this: PHP Code:
Then I tested phpMyAdmin, and everything seems to be fine there as well. The trouble started when I decided to follow the eBook "Dynamic webpages with PHP and MySQL". The first script in the book is a standard "Hello World" script, using echo. That's working. The second step is "making your first database". I followed the guide 100%, and did the following (from a terminal - as root): Quote:
PHP Code:
Then I try to look at the page, and there's the error: Quote:
The PHP-stuff I have installed is (alphabetically): - ampache - apache2-mod_php4 - php4 - php4-bz2 - php4-ftp - php4-gd - php4-mysql - php4-recode - php4-zlib - phpMyAdmin Anybody here who knows what's wrong? I'm desperate to find out, but since I'm pretty much a n00b when it comes to this, I don't quite know where to look... [edit] Removed my IP :) |
To be honest when you install packages like this you have no real idea what is happening in the background, that is on reason I usually choose to compile from source.
From your phpinfo page you can see that there is no mysql section as there should be. My guess from the package list you have given is that they are expecting you to use mysql as a php module. In this case you can try adding: extension=mysql.so To /etc/php.ini then restart apache. I really would reccomend installing from source though: http://lamps.efactory.de/e-index.shtml |
n5k, you may consider removing your IP address from your post. Why? An attacker may think your server is easier to get into, because you ask about service configuration. I can edit your post and remove the address, but decided not to. It's your decision.
The list of packages you posted looks correctly. You should have 'mysql.so' file in /usr/lib/php/extensions. Check it. Then modification of /etc/php.ini, as David suggests should help. |
Thanks!
That solved the problem. I added extension=mysql.so tp php.ini. About installing from source...it's not to easy when you're a n00b ;) Mara: I thought about the ip stuff, but decided to dont worry too much. My ISP delivers dynamic addresses anyway, so I'll probably have a new one tomorrow. Anyway, It's very nice of you to mention it. You can just delete the whole thread now, if you want. Thanks again! - Harald |
same prob
ok, i have the same problem, but either i dont know what i am doing, or something else, b/c when i put the line into the modules spot in the php.inc file, and then restart apache, it doesnt get better. I put the extensions=mysql.so in the extensions of php.inc, and then saved it and overwrote the origional file, and nothing changed....so what am i doing wrong? or is there more to it that just that line in the file?
thank you |
It is php.ini - not php.inc.
You will need to have the mysql shared library installed too. |
yea, my bad on the php.ini part, i had the right file, i just typed the wrong extension... so ne way...i have the lib for mysql installed, and have added the extensions line automatically added itself to my php file when i installed mysql i think, but it was there when i first checked, so i am assuming thats not the problem....ne way...im not sure why it worked for others and not for me...its a lil annoying...so ne help would be greeat....
|
I assume the line definately doesn't have a semi colon before it?
|
srry, good thought, but no, no ; b4
|
In that case I would reccomend using a source install so that you actually know what is going on and you can control the locations of the applications - see:
http://lamps.efactory.de/e-index.shtml |
All times are GMT -5. The time now is 03:20 AM. |