472,351 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,351 software developers and data experts.

My AMP application does not know the mysql data files reside on the same linux server

MLH
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.

Before I even created and installed the mysql database on the linux
server, the application was accessing the data from its remote
location (the same one used during programmer's development).
Installing the data here did not, of course, change that pointer.
I am quite new with AMP and linux. I'm uncertain just how these
items tie together.

How do I tell the PHP files that the data now resides on the same
linux server? And, is that all I have to do - just make configuration
changes in PHP?
Jul 23 '05 #1
4 2643
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.

Before I even created and installed the mysql database on the linux
server, the application was accessing the data from its remote
location (the same one used during programmer's development).
Installing the data here did not, of course, change that pointer.
I am quite new with AMP and linux. I'm uncertain just how these
items tie together.

How do I tell the PHP files that the data now resides on the same
linux server? And, is that all I have to do - just make configuration
changes in PHP?

I just double checked a dump file and it will restore to
whatever directory MySQL is using. As a result I suspect that
your problem is an Apache problem and not a MySQL problem.

When you access your application from the browser are you using:

http://localhost

If so, and you have an out of the box standard install, Apache
should be looking for your programs in /var/www. You can verify
this by running phpinfo.php (http://phpinfo.php) and seeing
what the value is for Document_Root in the Apache Environment
section of the output.

Also check to see if Apache is aware of MySQL by looking further
down in the phpinfo.php output for a section called "mysql".
(In my output it falls between "ctype" and "overload".)

HTH
Jerry

Check the output of phpinfo.php and y
Jul 23 '05 #2
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('localhost', '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.
Jul 23 '05 #3
MLH
Actually, digging through the many PHP files, I found this one.
Changing the values in it, I am now successfully connecting...
<?
// $connect =
mysql_connect("mysql01.inertiaservers.net","userna me","password");
// mysql_select_db("old_db");

$connect = mysql_connect("localhost","newuser","newpass");
mysql_select_db("new_db");
?>
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx

On Wed, 30 Mar 2005 13:16:35 GMT, jerry gitomer <jg******@verizon.net>
wrote:
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.

Before I even created and installed the mysql database on the linux
server, the application was accessing the data from its remote
location (the same one used during programmer's development).
Installing the data here did not, of course, change that pointer.
I am quite new with AMP and linux. I'm uncertain just how these
items tie together.

How do I tell the PHP files that the data now resides on the same
linux server? And, is that all I have to do - just make configuration
changes in PHP?

I just double checked a dump file and it will restore to
whatever directory MySQL is using. As a result I suspect that
your problem is an Apache problem and not a MySQL problem.

When you access your application from the browser are you using:

http://localhost

If so, and you have an out of the box standard install, Apache
should be looking for your programs in /var/www. You can verify
this by running phpinfo.php (http://phpinfo.php) and seeing
what the value is for Document_Root in the Apache Environment
section of the output.

Also check to see if Apache is aware of MySQL by looking further
down in the phpinfo.php output for a section called "mysql".
(In my output it falls between "ctype" and "overload".)

HTH
Jerry

Check the output of phpinfo.php and y


Jul 23 '05 #4
MLH
Bill, you hit it on the nose EXACTLY!
Digging through the many PHP files, I found this one.
Changing the values in it, I am now successfully connecting...

<?
// $connect = mysql_connect("mysql01.inertiaservers.net","old
user","oldpass");
// mysql_select_db("old_db");

$connect = mysql_connect("localhost","newuser","newpass");
mysql_select_db("new_db");
?>

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx

On Wed, 30 Mar 2005 22:13:36 -0800, Bill Karwin <bi**@karwin.com>
wrote:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx
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('localhost', '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.


Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Abby | last post by:
I have an application that is written in php/mysql on a Linux platform and need to transfer hosts. This is a session based application and I don't...
10
by: MLH | last post by:
I have a database named credifree. I did it with mysql's create command. Yet, I can find no files on my linux box except for a\ directory and a gif...
20
by: J-T | last post by:
We are working on an asp.net application which is a 3-tier application.I was aksed to create a component which monitors a folder and gets the file...
2
by: pc | last post by:
hi everyone, we have a server on which someone blew away the MySQL 4 progs directory before installing MySQL 5. When installing MySQL 5 the...
1
by: ScottB | last post by:
When creating website applications within Visual Studio 2005, I use the File System method because it meets the needs of our environment. In...
1
by: PowerLifter1450 | last post by:
I've been having a very rough time installinig mySQL on Linux. I have been following the instructions form here:...
7
by: Vincent Delporte | last post by:
Hello I'm interested in hearing reflections by seasoned web app developpers about the different ways to write PHP apps, and especially how they...
13
by: Kevin Liebowicz | last post by:
Yes, I wasted the past two days trying to fix this. Yes, this is on a Win2003 Server. Yes, this machine is a domain controller. Yes, I seen the...
5
by: Vik Rubenfeld | last post by:
Is there a way to import an MS Access database .mdb file into MySQL running locally on a Mac? Thanks in advance to all for any info.
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.