473,746 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2811
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_conn ect" 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.inertia servers.net","u sername","passw ord");
// mysql_select_db ("old_db");

$connect = mysql_connect(" localhost","new user","newpass" );
mysql_select_db ("new_db");
?>
xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxx

On Wed, 30 Mar 2005 13:16:35 GMT, jerry gitomer <jg******@veriz on.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.inertia servers.net","o ld
user","oldpass" );
// mysql_select_db ("old_db");

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

xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxx

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

xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xx
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_conn ect" 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
1914
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 know a lot about php/Linux/mysql, but can get by. I know windows/asp, etc. much more extensively. So, can I just move the whole thing over to a Windows server, upload the mysql backup database and change the settings for the db connection and have it work? Is there anything that would prevent...
10
8983
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 file that have the name credifree. Why? What's the name mysql might have made a database file under? Where is it stored? Just curious. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx mlh@appserver mlh $ mysql / -u root -p
20
4493
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 and pass them to a class library in our business logic layer(so far so good and easy).I initialize my class which is using a FileSystemWatcher in my Global.asax and everything works fine.I have found FileSystemWatcher class not very reliable and sometimes it behavies unexpectedly.I'm afriad that...
2
6115
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 installation failed with an error stating that it was unable to create system tables as the MySQL 4 directory did not exist. We are now unable to uninstall MySQL 5: # rpm -i
1
2903
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 choosing the location of the directory where the files will reside, I can choose a share on a network file server or a local directory on my workstation. I use the network file server share because there are others who need access to the files as well, plus the files also get backed up. The...
1
5285
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: http://www.hostlibrary.com/installing_apache_mysql_php_on_linux Everytime I get to #./configure it goes through all of the preparing tables and starting mysqlServer and daemon, but than immediaetly says "mysql ended" -- I try to do #make right after anyway, but I get the error "No targets specified and no makefile found" -- Any...
7
25718
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 compare in terms of performance, whether it's the PHP part or connections to MySQL. As far as I know, there are different ways to write a PHP application: - CGI, ie. the usual way : some PHP code in web pages, and the PHP interpreter is loaded each time a PHP page is called
13
4773
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 dozens of KB articles like this one: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q315158 But the problem is that 99% of these are for ASP .NET 1.x and this is .NET 2.x which I just installed to try and get .net working for the first time ever. I've see all the HACKS to get .net 1.x...
5
5269
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
8970
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8795
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9279
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8219
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6057
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4573
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3287
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2195
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.