LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-30-2008, 10:55 PM   #1
LuisVIII
LQ Newbie
 
Registered: Mar 2008
Location: Mexico
Distribution: Mandriva
Posts: 7

Rep: Reputation: 0
what does the message mean? when I start apache service


Hello everybody in this forum!!!!!

I have never installed or configured these three programs before, so I'll thank you a lot for your help ... What happens is that I want to configure the Apache + PHP + MySQL on Mandriva 2008, I have already set my repositories and with urpmi I've installed these programs through the console and apparently without any problems.


when I wrote the following to start the apache service it showed me a message:
[root@localhost etc]# service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]
[root@localhost etc]#

Can anybody tell what it means?: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName.

Best regards.
 
Old 03-31-2008, 12:19 AM   #2
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Looks like apache is reading your /etc/hosts file to determine your ipaddress and name for DNS.
If I remember, make sure you have something in your /etc/hosts file like, for example your ipaddress of the web server is 192.168.1.100 try:


Code:
127.0.0.1 localhost
192.168.1.100 localhost www.mydomain.com www
change www.mydoamin.com to whatever you have in the httpd.conf file

Last edited by fotoguy; 03-31-2008 at 12:23 AM.
 
Old 05-04-2008, 12:44 PM   #3
LuisVIII
LQ Newbie
 
Registered: Mar 2008
Location: Mexico
Distribution: Mandriva
Posts: 7

Original Poster
Rep: Reputation: 0
Well, thanks for the help, first of all I want to work locally in my computer to test programs in PHP, however, when I want to try to test them inside the /var/www/html, those programs only work if they are called "index".
Does anybody could tell me why this happens ..?

Thank you and best regards...
 
Old 05-04-2008, 01:58 PM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
If you don't pass a specific webpage in the URL (e.g. http://yoursite or http://yoursite/sub1; both are directories)), apache will try to serve a file that's specified using the DirectoryIndex. If you want a specific page, you have to specify that page in the URL (like http://yoursite/myfirstpage.html).

Below 2 examples of DirectorIndex; the first one is the default that comes with my Slackware12
Code:
DirectoryIndex index.html
DirectoryIndex index.html main.php
 
Old 05-12-2008, 11:54 PM   #5
LuisVIII
LQ Newbie
 
Registered: Mar 2008
Location: Mexico
Distribution: Mandriva
Posts: 7

Original Poster
Rep: Reputation: 0
I have already tested programs sending data in a form in HTML and receiving data in a PHP file, without any problems. I wanted to keep such data in a table of a database, and so I created a MySQL database (empleados) and a table (trabajadores) in which I inserted a record.
Code:
mysql> create database empleados;
mysql> create table trabajadores(nombre varchar(20), apellido varchar(20), domicilio(20));
mysql> insert into trabajadores values('Luis','Vidrio','Conocido 77');
if I consult in mysql it shows the following:
Code:
mysql> select * from trabajadores;
+--------+----------+-------------+
| nombre | apellido | domicilio   |
+--------+----------+-------------+
| Luis   | Vidrio   | Conocido 77 |
+--------+----------+-------------+
1 row in set (0.00 sec)
I'm running locally without password.
When I want to consult on a PHP file (muestrareg.php) , It doesn't show anything at all.
Code:
http://localhost/Nuevo/muestrareg.php
PHP Code:
<?php
    
//Variables del host y mysql
    
$numip='127.0.0.1';
    
$usuario='root';
    
$contra='';
     
    
//Conexion a la Base de Datos    
    
$conexion=mysql_connect($numip,$usuario,$contra);
    
//Selecciona una Base de Datos
    
mysql_select_db('empleados',$conexion);
    
$registros=mysql_query('SELECT * FROM trabajadores',$conexion);    

while (
$consulta mysql_fetch_array($registros))
{
    echo 
$consulta[nombre],'<br>';
    echo 
$consulta[apellido],'<br>';
    echo 
$consulta[domicilio],'<br>';
}
?>
Could anyone help with this problem?

Best Regards and thank you.

Last edited by LuisVIII; 05-12-2008 at 11:56 PM.
 
Old 05-13-2008, 02:56 AM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Check the returned values

mysql_connect will return a link identifier on success or FALSE on error
mysql_select_db will return TRUE on success and FALSE on error

Code:
if ($conexion === FALSE)
{
    echo "Could not connect";
}

if (mysql_select_db('empleados',$conexion) === FALSE)
{
    echo "Could not select database";
}
Code examples are not tested !
 
Old 05-14-2008, 09:13 AM   #7
LuisVIII
LQ Newbie
 
Registered: Mar 2008
Location: Mexico
Distribution: Mandriva
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Wim Sturkenboom View Post
Check the returned values

mysql_connect will return a link identifier on success or FALSE on error
mysql_select_db will return TRUE on success and FALSE on error

Code:
if ($conexion === FALSE)
{
    echo "Could not connect";
}

if (mysql_select_db('empleados',$conexion) === FALSE)
{
    echo "Could not select database";
}
Code examples are not tested !
Ok Wim Sturkenboom when run the program it tells "Could not connect" Why does it ocurr?

Regards.
 
Old 05-14-2008, 07:35 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
See this page: http://au2.php.net/manual/en/function.mysql-connect.php
You should bookmark www.php.net
 
Old 05-14-2008, 08:10 PM   #9
eggixyz
Member
 
Registered: Apr 2008
Posts: 310

Rep: Reputation: 30
Hey There,

Check this from your code

Quote:
$numip='127.0.0.1';
$usuario='root';
$contra='';

//Conexion a la Base de Datos
$conexion=mysql_connect($numip,$usuario,$contra);
and make sure that you can do that as the user that the webserver runs as on the command line. Usually a failure to connect to a mysql db that's on the same server as apache is a mysql login/permissions issue

Hope that helps

Mike
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
when i try to start samba pdc's smb service nmbd failed to start . sandeepchau123 Linux - Newbie 2 10-20-2007 01:59 PM
xinetd error message on Suse 9.1: service xxx, accept: Invalid argument (errno = 22) alteraffe Linux - Networking 1 02-15-2006 04:44 PM
apache service wont start tenmiles Linux - General 3 11-26-2004 12:45 AM
Apache won't start, but doesn't give error message escargot22026 Linux - Software 1 08-10-2004 09:34 PM
port25 and 110 send a service not found message(RH9) longc Linux - Software 1 09-22-2003 11:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration