LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cacti ??? (https://www.linuxquestions.org/questions/linux-newbie-8/cacti-696044/)

your_shadow03 01-12-2009 12:39 AM

I am trying to install latest PHP but am not finding teh right way to perform the same.

Agrouf 01-12-2009 12:43 AM

Could you please post the modified php.conf?
Do you have any error in error_log?

your_shadow03 01-12-2009 12:54 AM

the php.conf file :
Code:


# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#

LoadModule php4_module modules/libphp4.so
AddHandler php4-script .php
AddType text/html .php

#
# Cause the PHP interpreter to handle files with a .php extension.
#
# AddType application/x-httpd-php .php
# AddType application/x-httpd-php-source .phps

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
~
~
~

Code:

[root@bl ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: httpd: Could not determine the server's fully qualified domain name, using 10.14.236.97 for ServerName
                                                          [  OK  ]
[root@bl ~]# vi /etc/httpd/conf.d/php.conf

the error_log file:
Code:

[root@bl06dl380g5 logs]# tail -f error_log
[Mon Oct 20 16:47:49 2008] [notice] caught SIGTERM, shutting down
[Mon Oct 20 16:47:49 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Oct 20 16:47:49 2008] [notice] Digest: generating secret for digest authentication ...
[Mon Oct 20 16:47:49 2008] [notice] Digest: done
[Mon Oct 20 16:47:49 2008] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Mon Oct 20 16:47:49 2008] [notice] LDAP: SSL support unavailable
PHP Warning:  Unknown(): Unable to load dynamic library '/etc/php.d/msql.so' - /etc/php.d/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  Unknown(): Unable to load dynamic library '/etc/php.d/snmp.so' - /etc/php.d/snmp.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  Unknown(): Unable to load dynamic library '/etc/php.d/ldap.so' - /etc/php.d/ldap.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  Unknown(): Unable to load dynamic library '/etc/php.d/mysql.so' - /etc/php.d/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  Unknown(): Unable to load dynamic library '/etc/php.d/snmp.so' - /etc/php.d/snmp.so: cannot open shared object file: No such file or directory in Unknown on line 0
[Mon Oct 20 16:47:49 2008] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Mon Oct 20 16:47:49 2008] [notice] Apache/2.0.52 (Red Hat) configured -- resuming normal operations

The Above log is when I restart the apache

Agrouf 01-12-2009 02:29 AM

You forgot to uncomment the 2 AddType...
Uncomment them like this please:
Code:


# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#

LoadModule php4_module modules/libphp4.so
AddHandler php4-script .php
AddType text/html .php

#
# Cause the PHP interpreter to handle files with a .php extension.
#
#!!!! THERE !!!!
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
#!!!! THERE !!!!

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

This should solve your problem.

your_shadow03 01-12-2009 02:43 AM

Tried removing the comments..but ..Same Problem persist...pls Help

Agrouf 01-12-2009 06:42 AM

Did you restart apache?

your_shadow03 01-12-2009 10:03 PM

Yes..Now I have Installed PHP 5.0 but the same problem persists.
I am totally confused !!!
whats wrong its going on.
I tried putting a PHP Script inside /var/www/html/cacti/test.php
as:
Code:

<?php
echo "hi";
?>

And it opens in browser as "hi"

But why its not displaying anything now for cacti.
Even the logs are not displaying any error.

Can you please help me with the overall steps I am missing.

Agrouf 01-13-2009 12:33 AM

So it is not displaying anything? It does not display the php source anymore so?
Is the page just white? Can you post the source of the page from the browser?
Does it say it is downloading something or is it finished?
You need to tell me exactly what is happening.

your_shadow03 01-13-2009 12:35 AM

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8"></HEAD>
<BODY></BODY></HTML>

your_shadow03 01-13-2009 12:36 AM

I really dont know where the php hanging at?

Agrouf 01-13-2009 12:40 AM

Actually it looks like it is not hanging.
In the source, you see </HTML>
It means that the page has been fully transfered. It is just that cacti transmited an empty page, but it did transmit a page.
What is the address displayed in the address bar?

your_shadow03 01-13-2009 12:41 AM

http://10.14.236.97/cacti/index.php

your_shadow03 01-13-2009 12:45 AM

I tried putting free.php editing:
Code:

<?php
echo "hi";
?>

on inside cacti directory to see if it works !!
And it is working:
Code:

http://10.14.236.97/cacti/free.php
displays
Code:

hi

Agrouf 01-13-2009 02:17 AM

Does index.php still have the same content you posted ealier?
Could you please post include/auth.php?

your_shadow03 01-13-2009 02:38 AM

Code:

<?php
/*
 +-------------------------------------------------------------------------+
 | Copyright (C) 2004-2008 The Cacti Group                                |
 |                                                                        |
 | This program is free software; you can redistribute it and/or          |
 | modify it under the terms of the GNU General Public License            |
 | as published by the Free Software Foundation; either version 2          |
 | of the License, or (at your option) any later version.                  |
 |                                                                        |
 | 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.  See the          |
 | GNU General Public License for more details.                            |
 +-------------------------------------------------------------------------+
 | Cacti: The Complete RRDTool-based Graphing Solution                    |
 +-------------------------------------------------------------------------+
 | This code is designed, written, and maintained by the Cacti Group. See  |
 | about.php and/or the AUTHORS file for specific developer information.  |
 +-------------------------------------------------------------------------+
 | http://www.cacti.net/                                                  |
 +-------------------------------------------------------------------------+
*/

include("./include/global.php");

/* check to see if this is a new installation */
if (db_fetch_cell("select cacti from version") != $config["cacti_version"]) {
        header ("Location: install/");
        exit;
}

if (read_config_option("auth_method") != 0) {
        /* handle change password dialog */
        if ((isset($_SESSION['sess_change_password'])) && (read_config_option("webbasic_enabled") != "on")) {
                header ("Location: auth_changepassword.php?ref=" . (isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "index.php"));
                exit;
        }

        /* don't even bother with the guest code if we're already logged in */
        if ((isset($guest_account)) && (empty($_SESSION["sess_user_id"]))) {
  $guest_user_id = db_fetch_cell("select id from user_auth where username='" . read_config_option("guest_user") . "' and realm = 0 and enabled = 'on'");

                /* cannot find guest user */
                if (!empty($guest_user_id)) {
                        $_SESSION["sess_user_id"] = $guest_user_id;
                }
        }

        /* if we are a guest user in a non-guest area, wipe credentials */
        if (!empty($_SESSION["sess_user_id"])) {
                if ((!isset($guest_account)) && (db_fetch_cell("select id from user_auth where username='" . read_config_option("guest_user") . "'") == $_SESSION["sess_user_id"])) {
                        kill_session_var("sess_user_id");
                }
        }

        if (empty($_SESSION["sess_user_id"])) {
                include("./auth_login.php");
                exit;
        }elseif (!empty($_SESSION["sess_user_id"])) {
                $realm_id = 0;

                if (isset($user_auth_realm_filenames{basename($_SERVER["PHP_SELF"])})) {
                        $realm_id = $user_auth_realm_filenames{basename($_SERVER["PHP_SELF"])};
                }

                if ((!db_fetch_assoc("select
                        user_auth_realm.realm_id
                        from
                        user_auth_realm
                        where user_auth_realm.user_id='" . $_SESSION["sess_user_id"] . "'
                        and user_auth_realm.realm_id='$realm_id'")) || (empty($realm_id))) {

                        ?>
                        <html>

<head>
                                <title>Cacti</title>
                                <link href="include/main.css" rel="stylesheet">
                        </style>
                        </head>

                        <br><br>

                        <table width="450" align='center'>
                                <tr>
                                        <td colspan='2'><img src='images/auth_deny.gif' border='0' alt='Access Denied'></td>
                                </tr>
                                <tr height='10'><td></td></tr>
                                <tr>
                                        <td class='textArea' colspan='2'>You are not permitted to access this section of Cacti. If you feel that you
                                        need access to this particular section, please contact the Cacti administrator.</td>
                                </tr>
                                <tr>
                                        <td class='textArea' colspan='2' align='center'>( <a href='' onclick='javascript: history.back();'>Return</a> | <a href='index.php'>Login</a> )</td>
                                </tr>
                        </table>

                        </body>
                        </html>
                        <?php
                        exit;
                }
        }
}

?>



All times are GMT -5. The time now is 02:41 PM.