Re: [PHP-DB] Connecting to database fails

2016-08-15 Thread Rich Shepard

On Sat, 13 Aug 2016, Lester Caine wrote:


Do you actually have the postgresql PHP driver installed. Database drivers
are not installed by default as you only really need the ones you are
actually using.


  Should be installed:

/usr/lib/php/extensions/pgsql.so
/usr/lib/php/extensions/pdo_pgsql.so

and /etc/httpd/php.ini contains both.

  Still see the error that the connection cannot be established after
re-starting httpd.

  Where else do I look?

Thanks,

Rich

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Connecting to database fails

2016-08-13 Thread Lester Caine
On 14/08/16 00:00, Rich Shepard wrote:
>   Ah, yes. Pat likes MySQL/MariaDB so he does not build php to support
> postgres. I'll rebuild it and that should solve the problem.

I've been with Firebird/Interbase since before PHP existed ;)

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Connecting to database fails

2016-08-13 Thread Rich Shepard

On Sat, 13 Aug 2016, Rich Shepard wrote:


 Not installed. I'll search the Web to learn how to install it.


  Ah, yes. Pat likes MySQL/MariaDB so he does not build php to support
postgres. I'll rebuild it and that should solve the problem.

Thanks again,

Rich

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Connecting to database fails

2016-08-13 Thread Rich Shepard

On Sat, 13 Aug 2016, Lester Caine wrote:


Do you actually have the postgresql PHP driver installed. Database drivers
are not installed by default as you only really need the ones you are
actually using.


Lester,

  Well, that would make a difference. I did not know how to check for this.


Should be php5-pgsql


  Not installed. I'll search the Web to learn how to install it.

Thanks very much,

Rich

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Connecting to database fails

2016-08-13 Thread Lester Caine
On 13/08/16 21:23, Rich Shepard wrote:
> With no other PHP applications installed here I have no experience in
> determining where this stoppage occurs. Pointers on how to isolate the
> source of the problem, than how to fix it, are needed.

Do you actually have the postgresql PHP driver installed. Database
drivers are not installed by default as you only really need the ones
you are actually using.

Should be php5-pgsql

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] connecting to database..?

2001-05-21 Thread rice

Thank you very much for your help!!! It works now!!!

There are two methods to fix the error mentioned by Derick.

1. Supply the socket path to mysql_connect() furnction.
e.g. $link = mysql_connect(localhost:3306:/var/lib/mysql/mysql.sock,
user, password);
where 3306 is default port and /var/lib/mysql/mysql.sock is socket path
supplied by me.
If the socket path is omitted, it is /tmp/mysql.sock by default. But there
is no such file in /tmp, so I use slocate command and find it in
/var/lib/mysql. This method is not recommended because you have to submit
the path every time.

2. Set mysql.default_socket = /var/lib/mysql/mysql.sock in php.ini and
restart Apache. But make sure the path of mysql.sock first. (Thanks Jesse
^_^)

Jesse Scott [EMAIL PROTECTED] ?
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Make sure that your php.ini and your my.cnf both agree on where the socket
 file is going to be put.  And if you make any changes, be sure to restart
 both PHP/Apache and MySQL.  You might also check the logs and make sure
 that MySQL is actually launching, it might be encountering an error and
 quietly dieing as soon as you launch it.  I'm successfully running Apache
 1.3.19, PHP 4.0.5, and MySQL 3.23.38.  When I upgraded from MySQL 3.23.32
I
 had that same warning come up, all it took was restarting mysqld and the
 warning went away.

 Hope you can get it figured out...

 -Jesse

 At 12:48 AM 5/21/01 +0800, rice wrote:
 I have the same problem as you when using apache1.3.19, php4.0.5 and
 mysql3.23.38 and get the same warning message. I've spent many time to
 compile
 the system again but failed. So I forgive to use the newest version and
use
 apache1.3.17, php4.0.4 and mysql3.23.38. It works now!
 
 Hope someone can help!
 
 Derick Dorner [EMAIL PROTECTED] ?
 00cd01c0e13e$a10cda90$9865fea9@moax01">news:00cd01c0e13e$a10cda90$9865fea9@moax01...
 I receive the error when trying to connect to MySQL database:
 
 Warning: MySQL Connection Failed: Can't connect to local MySQL server
 through socket '/tmp/mysql.sock' (111) in /usr/home/cupid/www/sql.php on
 line 13
 
 The code I use to connect is:
 $link = mysql_connect (localhost, username, password);  file://with
 the username and pw filled in obviously.
 
 Is this some type of config problem between MySQL and PHP or what? Any
help
 is appreciated.
 It ia a LAMP system BTW.



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] connecting to database..?

2001-05-20 Thread rice

I have the same problem as you when using apache1.3.19, php4.0.5 and
mysql3.23.38 and get the same warning message. I've spent many time to
compile
the system again but failed. So I forgive to use the newest version and use
apache1.3.17, php4.0.4 and mysql3.23.38. It works now!

Hope someone can help!

Derick Dorner [EMAIL PROTECTED] ?
00cd01c0e13e$a10cda90$9865fea9@moax01">news:00cd01c0e13e$a10cda90$9865fea9@moax01...
I receive the error when trying to connect to MySQL database:

Warning: MySQL Connection Failed: Can't connect to local MySQL server
through socket '/tmp/mysql.sock' (111) in /usr/home/cupid/www/sql.php on
line 13

The code I use to connect is:
$link = mysql_connect (localhost, username, password);  file://with
the username and pw filled in obviously.

Is this some type of config problem between MySQL and PHP or what? Any help
is appreciated.
It ia a LAMP system BTW.

Derick




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]