Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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):
# mysqladmin -uroot create learndb
# CONNECT learndb
# CREATE TABLE person1
> id int NOT NULL AUTO_INCREMENT,
> firstname varvhar(25),
> lastname varchar(20),
> nick varchar(12),
> email varchar(35),
> salary int,
> PRIMARY KEY (id),
> UNIQUE id (id)
# INSERT INTO person1 VALUES ('1','John','Lever','John', 'firstname.lastname@example.org','75000');
# INSERT INTO person1 VALUES ('2','Camilla','Anderson','Rose', 'email@example.com','66000');
I then made a php-page for showing me the info in the database:
This is exactly what was written in the eBook.
Then I try to look at the page, and there's the error:
Fatal error: Call to undefined function: mysql_connect() in /srv/www/htdocs/viewdb.php on line 3
Now...I thought maybe that my PHP installation didn't support MySQL, so I updated the pacages, but that didn't help. I also tried to uninstall everything, and install it from scratch again, but that didn't help either.
The PHP-stuff I have installed is (alphabetically):
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...
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:
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.
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.
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?
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....