Linux / UNIX Tech Support Forum
This is a discussion on Getting PHP to access Mysql within the Databases servers forums, part of the Mastering Servers category; I am having problems accessing Mysql with PHP on Fedora Core 4. My code is one that I copied to ...
|
Register free or login to your existing account and remove all advertisements. |
|
|||||||
| Databases servers Discussions of databases of all types - especially MySQL. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I am having problems accessing Mysql with PHP on Fedora Core 4. My code is one that I copied to suit my case from Hard Coder as follows:
<? $dbhost="localhost"; $dbuser="root"; $dbpassrd="adminpass"; $dbname="guestbk_db"; $dbconnect=mysql_connect($dbhost, $dbuser, $dbpassrd) or die("Error Connecting the Database Server!"); mysql_select_db($dbname, $dbconnect) or die("Error Selecting the Database!"); ?> When I try to load the pages I get the error as defined on die() above. Any better way I can get it fixed. I googled some sites which hinted on installing php-mysql rpm. I did that but it went on asking for more files. I am using Fedora Core 4. I checked my installation on Webserver and Database Server, everything is installed. So where can be the problem? What do I do? ![]() Ngalye ![]() (newbie Linux newbie) |
| Sponsored Links | ||
|
|
|
||||
|
Use yum command to install php and related dependencies.
__________________
Vivek Gite Linux Evangelist |
|
|||
|
Quote:
For the code above, I got the PHP info page loaded. Here's the extract from Mysql support table. I copied everything for your expert eyes to figure out if there's something missing. mysql MySQL SupportenabledActive Persistent Links 0 Active Links 0 Client API version 4.1.11 MYSQL_MODULE_TYPE external MYSQL_SOCKET /var/lib/mysql/mysql.sock MYSQL_INCLUDE -I/usr/include/mysql MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient DirectiveLocal ValueMaster Valuemysql.allow_persistentOnOnmysql.connect_timeo ut6060mysql.default_hostno valueno valuemysql.default_passwordno valueno valuemysql.default_portno valueno valuemysql.default_socketno valueno valuemysql.default_userno valueno valuemysql.max_linksUnlimitedUnlimitedmysql.max_persist entUnlimitedUnlimitedmysql.trace_modeOffOff mysqli MysqlI SupportenabledClient API version 4.1.11 MYSQLI_SOCKET /var/lib/mysql/mysql.sock DirectiveLocal ValueMaster Valuemysqli.default_hostno valueno valuemysqli.default_port33063306mysqli.default_pwno valueno valuemysqli.default_socketno valueno valuemysqli.default_userno valueno valuemysqli.max_linksUnlimitedUnlimitedmysqli.reconnect OffOff Is it that I did not specify port number on my code? Over to you again,... Noel. |
![]() |
| Tags |
| lamp , linux , mysql , php , php-mysql , rpm , yum |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| repository access | myfoot | Web servers | 1 | 03-13-2009 01:01 PM |
| FTP Access Through Proxy | asifzias | Networking, Firewalls and Security | 2 | 01-31-2008 10:01 AM |
| MySQL remote server access howto | raj | Databases servers | 0 | 07-29-2007 05:32 AM |
| Remote CVS Access | rajuk | Linux software | 4 | 10-20-2006 10:41 AM |
| Debian recovery mode read only access make it write access | Donavit | Linux software | 1 | 12-30-2005 12:49 AM |