/var/www/html/cacti/include/database.php on line 19

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
PLEASE PLEASE

/var/www/html/cacti/include/database.php on line 19

Post by PLEASE PLEASE »

I did everything in the procedures to setup the cacti. But when I enter my web address/cacti I get directory listing of the cacti directory. If I try to exceute any file I get the following error
/var/www/html/cacti/include/database.php on line 19

Please Cacti Brains help me.

Remark: I tested PHP by making a test.php and it worked.
PLEASE PLEASE

STILL WAITING

Post by PLEASE PLEASE »

Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /var/www/html/cacti/include/database.php on line 19

This is the full error line!
shadow
Posts: 17
Joined: Tue Dec 10, 2002 4:48 am

Post by shadow »

looks like you havent compiled php with mysql support for your server.
You'll probably find you mysql.sock in

/var/lib/mysql/mysql.sock
if you installed mysql from RPM
the generic mysql suuport for php looks for it in /tmp

recompile php and be sure to add --with-mysql to your configure command
PLEASE PLEASE

I did

Post by PLEASE PLEASE »

I did compile it with sql! I will compile it again but any other suggestion!
shadow
Posts: 17
Joined: Tue Dec 10, 2002 4:48 am

Post by shadow »

Then create a file with this in to check

<? phpinfo() ?>

and access that from your browser.

This will show you what its compiled with/where its looking for mysql.sock etc
do a locate mysql.sock - if it doesnt exist then are you sure that mysql is running?
Did you mean you compiled with mysql or msql ?
Flux
Posts: 39
Joined: Fri Nov 01, 2002 12:37 pm

Post by Flux »

If you're using RedHat 8.0, check out this thread:

http://www.raxnet.net/board/viewtopic.p ... light=flux

Flux :o
PLEASE PLEASE

with mysql

Post by PLEASE PLEASE »

I did compile the php with mysql. I did the test.php and it showed me all the php config! what else shall i do please!

Thank for your help!
PLEASE PLEASE

This is the PHP output

Post by PLEASE PLEASE »

mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.39
MYSQL_MODULE_TYPE builtin
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_INCLUDE
MYSQL_LIBS

Directive Local Value Master Value
mysql.allow_persistent
On On
mysql.default_host
no value no value
mysql.default_password
no value no value
mysql.default_port
no value no value
mysql.default_socket
no value no value
mysql.default_user
no value no value
mysql.max_links
Unlimited Unlimited
mysql.max_persistent
Unlimited Unlimited
shadow
Posts: 17
Joined: Tue Dec 10, 2002 4:48 am

Post by shadow »

did you try and locate mysql.sock to see where it actually is?
khutton
Cacti User
Posts: 77
Joined: Tue Jun 18, 2002 9:01 am
Location: Alexandria, Virginia
Contact:

Post by khutton »

Looks to me like you either don't have MySQL running or the username and password in config.php are not correct. I don't think php is the problem. Just my 2 cents.

To check if MySQL is running cd to your mysql/bin dir and run this

./mysqladmin version

If you get the version screen with info about he MySQL you are running then MySQL is started. Try to verify the username and password you are using to log into MySQL from cacti. (config.php)

Kevin
shadow
Posts: 17
Joined: Tue Dec 10, 2002 4:48 am

Post by shadow »

try this

create this to check whether you php and mysql is actually working outside of cacti (bet you it doenst :) )

<?php
/* Connecting, selecting database */
$link = mysql_connect("localhost", "username", "password")
or die("Could not connect");
print "Connected successfully";

?>


Obviaously change username and password to values that will work on your mysql database
shadow
Posts: 17
Joined: Tue Dec 10, 2002 4:48 am

Post by shadow »

err

Just add this to just before the end

mysql_close($link);
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

Ok... Mr PLEASE PLEASE,

We already know that you compiled in mysql support and that php looks for socket file in /tmp. Now check where exactly socket file is placed. Please do the following command:
mysqladmin variables | grep socket
Copy/paste the output.

- bulek
michael.saville@lmco.com

Having similiar problem

Post by michael.saville@lmco.com »

Also getting the following:

Warning: Cannot add header information - headers already sent by (output started at c:\apache\htdocs\cacti\include\database.php:19) in c:\apache\htdocs\cacti\include\auth.php on line 23

HOWEVER - running on WinXP

===============================================
<? phpinfo() ?>
==========

PHP Version 4.2.3

System Windows NT 5.1 build 2600
Build Date Sep 6 2002 10:38:51
Server API Apache
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\WINDOWS\php.ini
Debug Build no
Thread Safety enabled

This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.2.0, Copyright (c) 1998-2002 Zend Technologies



--------------------------------------------------------------------------------

PHP 4 Credits

--------------------------------------------------------------------------------

Configuration
PHP Core
Directive Local Value Master Value
allow_call_time_pass_reference
On On
allow_url_fopen
1 1
always_populate_raw_post_data
0 0
arg_separator.input
& &
arg_separator.output
& &
asp_tags
Off Off
auto_append_file
no value no value
auto_prepend_file
no value no value
browscap
no value no value
default_charset
no value no value
default_mimetype
text/html text/html
define_syslog_variables
Off Off
disable_functions
no value no value
display_errors
On On
display_startup_errors
Off Off
doc_root
no value no value
enable_dl
On On
error_append_string
no value no value
error_log
no value no value
error_prepend_string
no value no value
error_reporting
2047 2047
expose_php
On On
extension_dir
c:\php\extensions c:\php\extensions
file_uploads
1 1
gpc_order
GPC GPC
highlight.bg
#FFFFFF #FFFFFF
highlight.comment
#FF9900 #FF9900
highlight.default
#0000CC #0000CC
highlight.html
#000000 #000000
highlight.keyword
#006600 #006600
highlight.string
#CC0000 #CC0000
html_errors
On On
ignore_user_abort
Off Off
implicit_flush
Off Off
include_path
.:\php\includes;c:\apache\htdocs\cacti .:\php\includes;c:\apache\htdocs\cacti
log_errors
Off Off
magic_quotes_gpc
On On
magic_quotes_runtime
Off Off
magic_quotes_sybase
Off Off
max_execution_time
200 200
open_basedir
no value no value
output_buffering
no value no value
output_handler
no value no value
post_max_size
8M 8M
precision
12 12
register_argc_argv
On On
register_globals
On On
safe_mode
Off Off
safe_mode_exec_dir
no value no value
safe_mode_gid
Off Off
safe_mode_include_dir
no value no value
sendmail_from
wittlewodi@comcast.net wittlewodi@comcast.net
sendmail_path
no value no value
short_open_tag
On On
SMTP
smtp.comcast.net smtp.comcast.net
sql.safe_mode
Off Off
track_errors
Off Off
unserialize_callback_func
no value no value
upload_max_filesize
2M 2M
upload_tmp_dir
C:\PHP\uploadtemp C:\PHP\uploadtemp
user_dir
no value no value
variables_order
EGPCS EGPCS
xmlrpc_error_number
0 0
xmlrpc_errors
Off Off
y2k_compliance
Off Off


standard
Regex Library Bundled library enabled
Dynamic Library Support enabled
Internal Sendmail Support for Windows enabled

Directive Local Value Master Value
assert.active
1 1
assert.bail
0 0
assert.callback
no value no value
assert.quiet_eval
0 0
assert.warning
1 1
safe_mode_allowed_env_vars
PHP_ PHP_
safe_mode_protected_env_vars
LD_LIBRARY_PATH LD_LIBRARY_PATH
url_rewriter.tags
a=href,area=href,frame=src,input=src,form=fakeentry a=href,area=href,frame=src,input=src,form=fakeentry


bcmath
BCMath support enabled


calendar
Calendar support enabled


com
Directive Local Value Master Value
com.allow_dcom
Off Off
com.autoregister_casesensitive
On On
com.autoregister_typelib
Off Off
com.autoregister_verbose
Off Off
com.typelib_file
no value no value


ftp
FTP support enabled


mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.39

Directive Local Value Master Value
mysql.allow_persistent
On On
mysql.default_host
no value no value
mysql.default_password
no value no value
mysql.default_port
no value no value
mysql.default_socket
no value no value
mysql.default_user
no value no value
mysql.max_links
Unlimited Unlimited
mysql.max_persistent
Unlimited Unlimited


odbc
ODBC Support enabled
Active Persistent Links 0
Active Links 0
ODBC library Win32

Directive Local Value Master Value
odbc.allow_persistent
On On
odbc.check_persistent
On On
odbc.default_db
no value no value
odbc.default_pw
no value no value
odbc.default_user
no value no value
odbc.defaultbinmode
return as is return as is
odbc.defaultlrl
return up to 4096 bytes return up to 4096 bytes
odbc.max_links
Unlimited Unlimited
odbc.max_persistent
Unlimited Unlimited


pcre
PCRE (Perl Compatible Regular Expressions) Support enabled
PCRE Library Version 3.4 22-Aug-2000


session
Session Support enabled

Directive Local Value Master Value
session.auto_start
Off Off
session.cache_expire
180 180
session.cache_limiter
nocache nocache
session.cookie_domain
no value no value
session.cookie_lifetime
0 0
session.cookie_path
/ /
session.cookie_secure
Off Off
session.entropy_file
no value no value
session.entropy_length
0 0
session.gc_maxlifetime
1440 1440
session.gc_probability
1 1
session.name
PHPSESSID PHPSESSID
session.referer_check
no value no value
session.save_handler
files files
session.save_path
C:\PHP\sessiondata C:\PHP\sessiondata
session.serialize_handler
php php
session.use_cookies
On On
session.use_trans_sid
0 0


xml
XML Support active
XML Namespace Support active
EXPAT Version 1.95.2


wddx
WDDX Support enabled


snmp
UCD-SNMP Support enabled
UCD-SNMP Version ucd-snmp-4.2.3


apache
Apache for Windows 95/NT

Apache Version Apache/1.3.24
Apache Release 10324100
Apache API Version 19990320
Hostname:Port hobbes.lndsd101.pa.comcast.net:80
Timeouts Connection: 300 - Keep-Alive: 15

Directive Local Value Master Value
child_terminate
0 0
engine
1 1
last_modified
0 0
xbithack
0 0


Apache Environment
Variable Value
COMSPEC C:\WINDOWS\system32\cmd.exe
DOCUMENT_ROOT c:/apache/htdocs
HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_ACCEPT_LANGUAGE en-us
HTTP_CONNECTION Keep-Alive
HTTP_HOST localhost
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
PATH C:\MySQL\bin;C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
REMOTE_ADDR 127.0.0.1
REMOTE_PORT 1652
SCRIPT_FILENAME c:/apache/htdocs/cacti/info.php
SERVER_ADDR 127.0.0.1
SERVER_ADMIN wittlewodi@comcast.net
SERVER_NAME hobbes.lndsd101.pa.comcast.net
SERVER_PORT 80
SERVER_SIGNATURE <ADDRESS>Apache/1.3.27 Server at hobbes.lndsd101.pa.comcast.net Port 80</ADDRESS>

SERVER_SOFTWARE Apache/1.3.27 (Win32) PHP/4.2.3
SystemRoot C:\WINDOWS
WINDIR C:\WINDOWS
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING
REQUEST_URI /cacti/info.php
SCRIPT_NAME /cacti/info.php


HTTP Headers Information
HTTP Request Headers
HTTP Request GET /cacti/info.php HTTP/1.1
Accept image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
Accept-Encoding gzip, deflate
Accept-Language en-us
Connection Keep-Alive
Host localhost
User-Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
HTTP Response Headers
X-Powered-By PHP/4.2.3
Keep-Alive timeout=15, max=100
Connection Keep-Alive
Transfer-Encoding chunked
Content-Type text/html


Additional Modules


Environment
Variable Value
ALLUSERSPROFILE C:\Documents and Settings\All Users
CommonProgramFiles C:\Program Files\Common Files
COMPUTERNAME HOBBES
ComSpec C:\WINDOWS\system32\cmd.exe
NUMBER_OF_PROCESSORS 1
OS Windows_NT
Path C:\MySQL\bin;C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE x86
PROCESSOR_IDENTIFIER x86 Family 6 Model 6 Stepping 2, AuthenticAMD
PROCESSOR_LEVEL 6
PROCESSOR_REVISION 0602
ProgramFiles C:\Program Files
SystemDrive C:
SystemRoot C:\WINDOWS
TEMP C:\WINDOWS\TEMP
TMP C:\WINDOWS\TEMP
USERPROFILE C:\Documents and Settings\LocalService
windir C:\WINDOWS


PHP Variables
Variable Value
PHP_SELF /cacti/info.php
_SERVER["COMSPEC"] C:\\WINDOWS\\system32\\cmd.exe
_SERVER["DOCUMENT_ROOT"] c:/apache/htdocs
_SERVER["HTTP_ACCEPT"] image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-us
_SERVER["HTTP_CONNECTION"] Keep-Alive
_SERVER["HTTP_HOST"] localhost
_SERVER["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
_SERVER["PATH"] C:\\MySQL\\bin;C:\\Perl\\bin\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem
_SERVER["REMOTE_ADDR"] 127.0.0.1
_SERVER["REMOTE_PORT"] 1652
_SERVER["SCRIPT_FILENAME"] c:/apache/htdocs/cacti/info.php
_SERVER["SERVER_ADDR"] 127.0.0.1
_SERVER["SERVER_ADMIN"] wittlewodi@comcast.net
_SERVER["SERVER_NAME"] hobbes.lndsd101.pa.comcast.net
_SERVER["SERVER_PORT"] 80
_SERVER["SERVER_SIGNATURE"] <ADDRESS>Apache/1.3.27 Server at hobbes.lndsd101.pa.comcast.net Port 80</ADDRESS>

_SERVER["SERVER_SOFTWARE"] Apache/1.3.27 (Win32) PHP/4.2.3
_SERVER["SystemRoot"] C:\\WINDOWS
_SERVER["WINDIR"] C:\\WINDOWS
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["REQUEST_METHOD"] GET
_SERVER["QUERY_STRING"]
_SERVER["REQUEST_URI"] /cacti/info.php
_SERVER["SCRIPT_NAME"] /cacti/info.php
_SERVER["PATH_TRANSLATED"] c:/apache/htdocs/cacti/info.php
_SERVER["PHP_SELF"] /cacti/info.php
_SERVER["argv"] Array
(
)


_SERVER["argc"] 0
_ENV["ALLUSERSPROFILE"] C:\\Documents and Settings\\All Users
_ENV["CommonProgramFiles"] C:\\Program Files\\Common Files
_ENV["COMPUTERNAME"] HOBBES
_ENV["ComSpec"] C:\\WINDOWS\\system32\\cmd.exe
_ENV["NUMBER_OF_PROCESSORS"] 1
_ENV["OS"] Windows_NT
_ENV["Path"] C:\\MySQL\\bin;C:\\Perl\\bin\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem
_ENV["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
_ENV["PROCESSOR_ARCHITECTURE"] x86
_ENV["PROCESSOR_IDENTIFIER"] x86 Family 6 Model 6 Stepping 2, AuthenticAMD
_ENV["PROCESSOR_LEVEL"] 6
_ENV["PROCESSOR_REVISION"] 0602
_ENV["ProgramFiles"] C:\\Program Files
_ENV["SystemDrive"] C:
_ENV["SystemRoot"] C:\\WINDOWS
_ENV["TEMP"] C:\\WINDOWS\\TEMP
_ENV["TMP"] C:\\WINDOWS\\TEMP
_ENV["USERPROFILE"] C:\\Documents and Settings\\LocalService
_ENV["windir"] C:\\WINDOWS


PHP License
This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.


===============================================

<?php
/* Connecting, selecting database */
$link = mysql_connect("localhost", "username", "password")
or die("Could not connect");
print "Connected successfully";

?>

Returned:
Connected Successfully

==============================================

mysqladmin variables
==============

+---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Variable_name | Value |
+---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| back_log | 50 |
| basedir | C:\mysql\ |
| binlog_cache_size | 32768 |
| character_set | latin1 |
| character_sets | latin1 big5 czech euc_kr gb2312 gbk sjis tis620 ujis dec8 dos german1 hp8 koi8_ru latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr win1251ukr greek win1250 croat cp1257 latin5 |
| concurrent_insert | ON |
| connect_timeout | 5 |
| datadir | C:\mysql\data\ |
| delay_key_write | ON |
| delayed_insert_limit | 100 |
| delayed_insert_timeout | 300 |
| delayed_queue_size | 1000 |
| flush | OFF |
| flush_time | 1800 |
| have_bdb | NO |
| have_gemini | NO |
| have_innodb | DISABLED |
| have_isam | YES |
| have_raid | NO |
| have_openssl | NO |
| init_file | |
| innodb_additional_mem_pool_size | 1048576 |
| innodb_buffer_pool_size | 8388608 |
| innodb_data_file_path | |
| innodb_data_home_dir | |
| innodb_file_io_threads | 4 |
| innodb_force_recovery | 0 |
| innodb_thread_concurrency | 8 |
| innodb_flush_log_at_trx_commit | 0 |
| innodb_fast_shutdown | ON |
| innodb_flush_method | |
| innodb_lock_wait_timeout | 50 |
| innodb_log_arch_dir | |
| innodb_log_archive | OFF |
| innodb_log_buffer_size | 1048576 |
| innodb_log_file_size | 5242880 |
| innodb_log_files_in_group | 2 |
| innodb_log_group_home_dir | |
| innodb_mirrored_log_groups | 1 |
| interactive_timeout | 28800 |
| join_buffer_size | 131072 |
| key_buffer_size | 8388600 |
| language | C:\mysql\share\english\ |
| large_files_support | ON |
| log | OFF |
| log_update | OFF |
| log_bin | OFF |
| log_slave_updates | OFF |
| log_long_queries | OFF |
| long_query_time | 10 |
| low_priority_updates | OFF |
| lower_case_table_names | 1 |
| max_allowed_packet | 1048576 |
| max_binlog_cache_size | 4294967295 |
| max_binlog_size | 1073741824 |
| max_connections | 100 |
| max_connect_errors | 10 |
| max_delayed_threads | 20 |
| max_heap_table_size | 16777216 |
| max_join_size | 4294967295 |
| max_sort_length | 1024 |
| max_user_connections | 0 |
| max_tmp_tables | 32 |
| max_write_lock_count | 4294967295 |
| myisam_max_extra_sort_file_size | 256 |
| myisam_max_sort_file_size | 2047 |
| myisam_recover_options | 0 |
| myisam_sort_buffer_size | 8388608 |
| named_pipe | OFF |
| net_buffer_length | 16384 |
| net_read_timeout | 30 |
| net_retry_count | 10 |
| net_write_timeout | 60 |
| open_files_limit | 0 |
| pid_file | C:\mysql\data\hobbes.pid |
| port | 3306 |
| protocol_version | 10 |
| record_buffer | 131072 |
| record_rnd_buffer | 131072 |
| query_buffer_size | 0 |
| safe_show_database | OFF |
| server_id | 0 |
| slave_net_timeout | 3600 |
| skip_locking | ON |
| skip_networking | OFF |
| skip_show_database | OFF |
| slow_launch_time | 2 |
| socket | MySQL |
| sort_buffer | 2097144 |
| sql_mode | 0 |
| table_cache | 64 |
| table_type | MYISAM |
| thread_cache_size | 0 |
| thread_stack | 65536 |
| transaction_isolation | READ-COMMITTED |
| timezone | Eastern Standard Time |
| tmp_table_size | 33554432 |
| tmpdir | C:\WINDOWS\TEMP\ |
| version | 3.23.54-nt |
| wait_timeout | 28800 |
+---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

===============================================

Can anyone tell me how I messed this up so bad??? pls...
thank you very much in advanced.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests