| Bill Karwin 2005-03-31, 7:01 am |
| MLH wrote:
> A programmer developed an AMP (Apache/MySQL/PHP) application
> for me. When he was done, he sent me the PHP files and the MySQL
> dump file. Now, when I connect to the application on my LAN using
> http://192.168.1.106/~mlh/credifree/index.php the AMP app still
> thinks the data resides somewhere else. It runs fine - as long as I
> leave my LAN's external internet connection up. But if I unplug my
> LAN from the world, my app locks up.
Sounds like the PHP files are specifying the server name where the MySQL
database resides. It should probably specify 'localhost' if PHP and the
database are on the same server.
Typically in the PHP language one uses a function called mysql_connect()
to specify the name of the host, and the MySQL user and password to use
when connecting to the MySQL database (the database name is specified in
a different function call, after the PHP application successfully
connects to the MySQL server).
Look for "mysql_connect" in your PHP files. The first argument to the
function should be the name of the host where the MySQL database lives.
I'm guessing it contains some external Internet site name or IP
address, and you can probably replace that with "localhost":
$link = mysql_connect('local
host', 'mysql_user', 'mysql_password');
See http://us4.php.net/function.mysql-connect for more reference docs
and examples for this function.
Be sure to search for _all_ places where PHP calls mysql_connect().
There's no guarantee it's used in only one place in the code.
Regards,
Bill K.
|