Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
I am using slackware12.2, I have a mysql5.0.67 which system has install for me and I had install a zend server4.0.6 from http://www.zend.com/products/server/, It runs all right .When I try to run my php code in zend server(apache),it break out an error with connect to mysql.
But when I login mysql in command line ,I can see all my databases what my codes need in it.
The code was running well in windows. I try to build the zend+mysql+php environment several times in linux but never success。
how can I do to let it runs all right ? some one said I can edit php.ini, It's it right ? how can I do ?
I try my best to express my trouble, Wait for your help .
Last edited by liuguobiao; 01-06-2010 at 01:11 AM.
I am using slackware12.2, I have a mysql5.0.67 which system has install for me and I had install a zend server4.0.6 from http://www.zend.com/products/server/, It runs all right .When I try to run my php code in zend server(apache),it break out an error with connect to mysql.
But when I login mysql in command line ,I can see all my databases what my codes need in it.
The code was running well in windows. I try to build the zend+mysql+php environment several times in linux but never success。
how can I do to let it runs all right ? some one said I can edit php.ini, It's it right ? how can I do ?
I try my best to express my trouble, Wait for your help .
You don't post any of the code, actual error messages, or give any details, how can you expect anyone to help?
Provide details, error(s), etc., and we can try. Right now, chances are good that your code is not passing the right parameters to make the MySQL connection, or that you haven't installed the php-mysql modules.
and I found the $link is empty. So I think what TB0ne has said was right :I haven't installed the php-mysql modules. I didn't know whether it been installed or not beacause I just type './install.sh' to install zend server for linux.
If I want to install php-mysql modules in zend now what can I do ?
Distribution: Linux Mint 14 (Cinnamon), Xubuntu 12.04, Ubuntu 10.04
Posts: 49
Rep:
As far as I know, MySQL extension is installed by default with Zend Server.
You can check that by logging into the Zend Server UI (probably http://localhost:10081 on your machine) and going to Server Setup | Extensions. Look for it there and see if it is on.
I assume it is loaded, otherwise you would have gotten a
Code:
Fatal error: Call to undefined function mysql_connect() in /var/www/yourpage.php on line ...
I suggest you add some more verbosity to your code, e.g.
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /dream/workplace/server/mysql.php on line 5 Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Then it run all right with you code.
But in my code .It has error with the same Exception information I have show.
Here is my IndexController.php file ( just show important code ):
Code:
<?php
class IndexController extends Zend_Controller_Action {
public function init() {
/* Initialize action controller here */
}
public function indexAction() {
$division = new Default_Model_DbTable_Division ( );
//class Default_Model_DbTable_Division is extends from
the class Zend_Db_Table_Abstract
$type1 = $division->fetchAll ();
echo "good";exit(1);
$type2 = array ();
foreach ( $type1 as $row ) {
$type2 [$row->divisionID] = $row->type;
}
$this->view->type2 = $type2;
}
}
( Reiterate That my code were running well in windows + zend + mysql )
With my test ,I found the code stop in the line "$type1 = $division->fetchAll ();"
The line just to fetch all data from database.
I can sure ,These error are with MYSQL , But I can't found what 's wrong with it. I google it ,but few people meet this problem or some body ask but there are no people reply him ...
Trying.......and Waiting .....
Last edited by liuguobiao; 01-25-2010 at 12:47 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.