ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
PLEASE EXCUSE THE HUGE POST. I AM TRYING TO BE AS SPECIFIC AS POSSIBLE...ALTHOUGH I'M PROBABLY STILL LEAVING SOMETHING OUT! HAHAHA
Hello all. I'm very new to the Linux world and loving it...although the transition from the windows world has been frustrating at times. I'm also even newer to PHP and MySQL. Here is the situation I need help with, which I've been researching in this site and many others for a looooooong time now.
I am trying to get a product called PHProjekt out of Germany (which uses a LAMP configuration) up and running so my company can share contacts, schedules, tasks, and other info with the ability to modify tables to our specific needs. I have looked at probably 70-80 contact managers, including LDAP and this one seems like a great product and the best for our business. Anyway, I have RH 8.0 up and running with MySQL 4.0, PHP 4.2, and apache 2.0.
PLEASE NOTE: I tried the following with the old version of MySQL that comes with RH 8 and installed the php-mysql rpm and still couldn't get it to work.
I have the PHP and Apache running correctly I think as I'm able to see the server from my work station's browser including the phpinfo file. I tried writing a sample script that tests a connection to a MySQL database, which I copied out of Wrox Publishing's "Beginning PHP4" book. After I create the script file, save it in my /var/www/html directory, and try to get it to work in my browser, I get the following error:
Fatal error: Call to undefined function: mysql_connect() in /var/www/html/connect.php on line 4
Line 4 in my script is:
$link_id = mysql_connect("homer", "phpuser", "phpass");
In my phpinfo file, which I can bring up in my browser, the configuration section for mysql has '--with-mysql=shared,/usr'
The path to the mysql database looks wrong to me and/or I need to recompile php to use mysql. I have downloaded the new php 4.3.1 and did:
and everything seemed to go in fine. (note: I tried the above by just pointing to the directory [mysql]and it gave me an error saying missing header files or something similar, so I pointed it to the actual header file and it worked) Then I tried to do a make and a make install and PHP did not want to install...no error messages but a bunch of repeated paragraphs of text jumble went up on the screen and never ended...until I cancelled it.
So, if any one can point me in the right direction with a scenerio of what I just described (RH 8.0, mysql 4.0, php 4.2.2...although I have downloaded the new php 4.3.1, and apache 2.0), that would make a very frustrated newbie incredibly happy!
A couple of other notes: When I installed the mysql 4.0, I installed the rpm from my /usr/local directory...not sure if that makes a bit of difference or not?? I have looked on the web and found some stuff for a LAMP configuration...but nothing specific to RH 8.0, so if anyone knows of one, please post a link.
Whew! If you've read this entire post, thanks! And if anyone can help out, you ROCK!
$link_id = mysql_connect("homer", "phpuser", "phpass") or die("MySQL Error No.".mysql_errno().": ".mysql_error());
This will give a verbose explanation of the error.
Also, be sure you are selecting a database to use. You should have a line in there someplace that says:
$default_dbname = "super database of destruction";
mysql_select_db($default_dbname, $link_id);
Let us know what the full description of the error is.
Also, there should be a simple example script in the book to make sure the connection to your database works. You may want to run that to make sure you can connect properly. If it doesn't have an example, I can post one for you.
The script that I typed on the server actually didn't have a space in it...my last post I re-typed it up really fast. I'm going to re-install RH 8 again (this time with the mysql and php that come with the distro) and also install the php-mysql package and see if that will work.
Have any of you out there that are reading this set up a LAMP configuration on RH 8? I'm trying to follow the RH 8 Bible's instructions for getting all of these parts running but if anyone could explain the steps to accomplishing a LAMP on RH that would help out a frustrated newbie tremendously! Thanks.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.