08-15-2002
run ./configure --help to get to see where you can set
the sock file for mysql.
For recent versions of PHP, you can use "localhost:/path/to/mysql.sock"
in your mysql_connect call to tell it where to find the socket.
8 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I recently installed mysql-standard-5.0.21-solaris9-sparc-64bit.pkg on a Solaris 9 machine (SunOS 5.9 Generic_118558-19 sun4u sparc SUNW,Ultra-250). The package installation went very smooth, however, starting mysql is a different story. I get the message below everytime I try to start mysql:
#... (2 Replies)
Discussion started by: xnightcrawl
2 Replies
2. Red Hat
I have installed mysql-connector-odbc-5.1.5-0.i386.rpm and libtools on my Fedora12 system.
Updating with yum says that there is nothing to update.
Updating with rpm -Uvh mysql-connector-odbc-5.1.7-0.i386.rpm fails with the same missing dependencies as for the 64-bit version.
Should I force... (4 Replies)
Discussion started by: Bengbers
4 Replies
3. UNIX for Dummies Questions & Answers
mysql.sock file is missing in /opt/lampp/etc/ is there any backup file available in unix...
since without that file .. project is not opening..
reply me as soon as possible ... (19 Replies)
Discussion started by: senkerth
19 Replies
4. UNIX and Linux Applications
Hi,
SLES11 : I've installed the following MySQL Package:
MySQL-client-community-5.1.54-1.sles11.x86_64
MySQL-devel-community-5.1.54-1.sles11.x86_64
MySQL-server-community-5.1.54-1.sles11.x86_64
MySQL-shared-community-5.1.54-1.sles11.x86_64Problem: I don't see any my.cnf file (find / -name... (1 Reply)
Discussion started by: hiddenshadow
1 Replies
5. UNIX and Linux Applications
After doing a yum install mysql mysql-server on Fedora 14 I wasn't able to fully install the packages correctly. It installed MySQL 5.1. I was getting the following error when running the:
mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)... (3 Replies)
Discussion started by: jastanle84
3 Replies
6. Homework & Coursework Questions
I am trying to start a server for a class I am in but... mysql won't start with this error ( ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) )
---------- Post updated at 03:51 PM ---------- Previous update was at 03:50 PM ----------
... (2 Replies)
Discussion started by: Slayer939
2 Replies
7. UNIX for Dummies Questions & Answers
My dedicated server is VERY old (running Apache/1.3.37 (Unix) PHP/4.4.4 FrontPage/5.0.2.2510).
We have a script that runs and manages our customer database. Early in the morning last Friday, it was working fine and processed data as usual. Later in the day, we got this error:
Cannot... (2 Replies)
Discussion started by: SurfMe69
2 Replies
8. Red Hat
hi
i started in the apache userdirectory and virtual host
now iwant installtion wordpress in home one of the useres
But this error is
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
And the configuration files and other items I was enter... (0 Replies)
Discussion started by: mnnn
0 Replies
LEARN ABOUT PHP
socket_bind
SOCKET_BIND(3) 1 SOCKET_BIND(3)
socket_bind - Binds a name to a socket
SYNOPSIS
bool socket_bind (resource $socket, string $address, [int $port])
DESCRIPTION
Binds the name given in $address to the socket described by $socket. This has to be done before a connection is be established using
socket_connect(3) or socket_listen(3).
PARAMETERS
o $socket
- A valid socket resource created with socket_create(3).
o $address
- If the socket is of the AF_INET family, the $address is an IP in dotted-quad notation (e.g. 127.0.0.1). If the socket is of
the AF_UNIX family, the $address is the path of a Unix-domain socket (e.g. /tmp/my.sock).
o $port (Optional)
- The $port parameter is only used when binding an AF_INET socket, and designates the port on which to listen for connections.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
The error code can be retrieved with socket_last_error(3). This code may be passed to socket_strerror(3) to get a textual explanation of
the error.
EXAMPLES
Example #1
Using socket_bind(3) to set the source address
<?php
// Create a new socket
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
// An example list of IP addresses owned by the computer
$sourceips['kevin'] = '127.0.0.1';
$sourceips['madcoder'] = '127.0.0.2';
// Bind the source address
socket_bind($sock, $sourceips['madcoder']);
// Connect to destination address
socket_connect($sock, '127.0.0.1', 80);
// Write
$request = 'GET / HTTP/1.1' . "
" .
'Host: example.com' . "
";
socket_write($sock, $request);
// Close
socket_close($sock);
?>
NOTES
Note
This function must be used on the socket before socket_connect(3).
Note
Windows 9x/ME compatibility note: socket_last_error(3) may return an invalid error code if trying to bind the socket to a wrong
address that does not belong to your machine.
SEE ALSO
socket_connect(3), socket_listen(3), socket_create(3), socket_last_error(3), socket_strerror(3).
PHP Documentation Group SOCKET_BIND(3)