php errors=Fixed thanks all
Moderators: Developers, Moderators
php errors=Fixed thanks all
Hello, I have followed the directions setup users, mysql etc.. but when I goto http://myip/cacti/ all I get is whats listed in that directory. I ran php cmd.php manually and this is what was spewed out:
spyder:/var/www/htdocs/cacti# php cmd.php
X-Powered-By: PHP/4.2.3
Content-type: text/html
PHP Notice: Undefined variable: database in /var/www/htdocs/cacti/include/database.php on line 17
PHP Fatal error: Call to undefined function: mysql_connect() in /var/www/htdocs/cacti/include/database.php on line 19
Slackware 8.1
WWW Server version: Apache/2.0.43
Thanks in advance
-Mike
spyder:/var/www/htdocs/cacti# php cmd.php
X-Powered-By: PHP/4.2.3
Content-type: text/html
PHP Notice: Undefined variable: database in /var/www/htdocs/cacti/include/database.php on line 17
PHP Fatal error: Call to undefined function: mysql_connect() in /var/www/htdocs/cacti/include/database.php on line 19
Slackware 8.1
WWW Server version: Apache/2.0.43
Thanks in advance
-Mike
Last edited by Mikeeo on Wed Nov 06, 2002 10:57 am, edited 2 times in total.
Can you search this board before please? This topic looks very similar to yours:
http://www.raxnet.net/board/viewtopic.php?t=946
- bulek
http://www.raxnet.net/board/viewtopic.php?t=946
- bulek
bulek thanks for the reply here is the output from the test.php file you said to created in the other thread:
Configure Command './configure' '--prefix=/usr' '--disable-static' '--with-apxs2=/usr/sbin/apxs' '--enable-discard-path' '--with-config-file-path=/etc/apache2' '--enable-safe-mode' '--with-openssl' '--enable-bcmath' '--with-bz2' '--enable-pic' '--enable-calendar' '--enable-ctype' '--with-imap=shared' '--with-imap-ssl' '--enable-dba=shared' '--enable-dbase=shared' '--with-gdbm' '--with-db2' '--with-db3' '--enable-ftp' '--with-gd=/usr' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-freetype-dir=/usr/X11R6' '--with-t1lib=/usr' '--with-gmp=shared' '--with-mcrypt=shared,/usr' '--with-unixODBC=shared,/usr' '--with-pgsql=shared,/usr' '--with-mysql=shared,/usr' '--with-pspell=shared,/usr' '--with-xml' '--enable-trans-sid' '--enable-shmop' '--enable-sockets' '--with-regex=php' '--enable-sysvsem' '--enable-sysvshm' '--enable-yp' '--enable-inline-optimization' '--enable-memory-limit' '--with-tsrm-pthreads' '--enable-shared' '--disable-debug' '--with-zlib=shared,/usr'
Configure Command './configure' '--prefix=/usr' '--disable-static' '--with-apxs2=/usr/sbin/apxs' '--enable-discard-path' '--with-config-file-path=/etc/apache2' '--enable-safe-mode' '--with-openssl' '--enable-bcmath' '--with-bz2' '--enable-pic' '--enable-calendar' '--enable-ctype' '--with-imap=shared' '--with-imap-ssl' '--enable-dba=shared' '--enable-dbase=shared' '--with-gdbm' '--with-db2' '--with-db3' '--enable-ftp' '--with-gd=/usr' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-freetype-dir=/usr/X11R6' '--with-t1lib=/usr' '--with-gmp=shared' '--with-mcrypt=shared,/usr' '--with-unixODBC=shared,/usr' '--with-pgsql=shared,/usr' '--with-mysql=shared,/usr' '--with-pspell=shared,/usr' '--with-xml' '--enable-trans-sid' '--enable-shmop' '--enable-sockets' '--with-regex=php' '--enable-sysvsem' '--enable-sysvshm' '--enable-yp' '--enable-inline-optimization' '--enable-memory-limit' '--with-tsrm-pthreads' '--enable-shared' '--disable-debug' '--with-zlib=shared,/usr'
Ok, let's see if we can nail down your problem. The directory listing is because Apache isn't recognizing 'index.php' as a directory index. Find the 'DirectoryIndex' directive in your httpd.conf file and make sure 'index.php' gets tacked onto the end somewhere.
The undefined variable errors are because PHP's error level is set to report warnings. Open up your php.ini, and make sure the following is set:
Lastly, I noticed that you were getting MySQL related errors. I can't tell by the data given if this is affecting both the apache module and PHP binary, but I am going to assume just the binary for now. You will need to re-compile your php binary with MySQL support. The easiest way to do this is to download the latest PHP source and use the following configure command:
Of course that is ignoring any other special options you may need, but that part is up to you.
-Ian
The undefined variable errors are because PHP's error level is set to report warnings. Open up your php.ini, and make sure the following is set:
Code: Select all
error_reporting = E_ALL & ~E_NOTICE
Code: Select all
./configure --with-mysql
-Ian
Rax thanks for the reply. I did add the Directory index and I do not get a listing anymore, just a blank page. I also added error_reporting but can still see the same errors in /var/log/apache2/error_log. I emailed the person that created the php package for slackware and he assures me that ./configure --with-mysql was used. If you like you can go here: http://68.82.44.243/cacti/test.php and take a look at the test page bulek told me to do and it shows what options were used. If you really think my php is broken I will compile from source I just hate doing that because its a pain to upgrade.
OK I totally removed MySQL from my system. I run the php <path to>/cmd.php and get the same errors:
PHP Notice: Undefined variable: database in /var/www/htdocs/cacti/include/database.php on line 17
PHP Fatal error: Call to undefined function: mysql_connect() in /var/www/htdocs/cacti/include/database.php on line 19
So is the script failing to find mysql?
PHP Notice: Undefined variable: database in /var/www/htdocs/cacti/include/database.php on line 17
PHP Fatal error: Call to undefined function: mysql_connect() in /var/www/htdocs/cacti/include/database.php on line 19
So is the script failing to find mysql?
Hey, put MySQL back
The output of the test page showing options used for configure script is not enough. You need to scroll the page down looking for mysql section. There are a lot of modules mentioned on this page with their parameters and settings... mysql has to be one of them. Can you locate it and give us some feedback?
If you see mysql support as 'disabled' check php.ini if there is uncommented line inside:
- bulek
The output of the test page showing options used for configure script is not enough. You need to scroll the page down looking for mysql section. There are a lot of modules mentioned on this page with their parameters and settings... mysql has to be one of them. Can you locate it and give us some feedback?
If you see mysql support as 'disabled' check php.ini if there is uncommented line inside:
BTW, the web link you specified does not work for me.extension=mysql.so
- bulek
I was tinkering with apache sorry the page should load just fine now.
I enabled extension=mysql.so
and I the path to that fine in the extension_dir
this is the output now:
php /var/www/htdocs/cacti/cmd.php
Content-type: text/html
PHP Warning: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-zts-20020429/mysql.so' - /usr/lib/php/extensions/no-debug-zts-20020429/mysql.so: undefined symbol: core_globals_id in Unknown on line 0
X-Powered-By: PHP/4.2.3
Content-type: text/html
PHP Notice: Undefined variable: database in /var/www/htdocs/cacti/include/database.php on line 17
PHP Fatal error: Call to undefined function: mysql_connect() in /var/www/htdocs/cacti/include/database.php on line 19
I enabled extension=mysql.so
and I the path to that fine in the extension_dir
this is the output now:
php /var/www/htdocs/cacti/cmd.php
Content-type: text/html
PHP Warning: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-zts-20020429/mysql.so' - /usr/lib/php/extensions/no-debug-zts-20020429/mysql.so: undefined symbol: core_globals_id in Unknown on line 0
X-Powered-By: PHP/4.2.3
Content-type: text/html
PHP Notice: Undefined variable: database in /var/www/htdocs/cacti/include/database.php on line 17
PHP Fatal error: Call to undefined function: mysql_connect() in /var/www/htdocs/cacti/include/database.php on line 19
Who is online
Users browsing this forum: No registered users and 2 guests