Upgrade from 0.8.7a to 0.8.7b: 'Invalid PHP_SELF Path'

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

Moderators: Developers, Moderators

User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I believe the megaman fix to be secure.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
tymbow
Cacti User
Posts: 54
Joined: Sat May 14, 2005 8:00 pm

Post by tymbow »

Make that 5 people with the problem (except I am on Windows).
faustovetter@gmail.com
Posts: 4
Joined: Thu Feb 14, 2008 11:54 am

Possible workaround without touching the code

Post by faustovetter@gmail.com »

Hi,

I also observed this behavior. So, to make sure it runs, I just assured that alias path on the web-browser is the same as the cacti linux sub-folder.

Clarifying what I wrote above:

E.g.:
your alias on your browser: http://localhost/cacti/index.php
your cacti home folder: /home/cactiuser/cacti/

Cacti sub-folder: /cacti
Web-browser alias: /cacti

So cacti can find all files on both structures (alias and path).

:D
chronos
Posts: 5
Joined: Tue Feb 12, 2008 1:07 pm

Post by chronos »

It's a way around the bug, but doesn't solve it unfortunately. And you're also exposing yourself to potential future exploits by having a "standard" xxx/cacti form.

The FreeBSD port (and I assume Linux's "ports/rpm") install in a xxx/cacti folder and the modification of the Alias is to somewhat secure cacti from standard exploits that target xxx/cacti.
just_me
Posts: 1
Joined: Thu Mar 16, 2006 4:00 am

Post by just_me »

Hello!

I have the FreeBSD installation from ports:

I added some debug here:

Code: Select all

                               echo "\nInvalid PHP_SELF Path \n";
                                echo $_SERVER["PHP_SELF"] ;
                                echo " - ";
                                echo $_SERVER["DOCUMENT_ROOT"];
                                echo " - ";
                                echo $_SERVER["SCRIPT_FILENAME"];
                               exit;
This show me:
Invalid PHP_SELF Path /cacti/index.php - /usr/local/www/apache22/data - /usr/local/share/cacti/index.php

As we can see, this installed not under DOCUMENT_ROOT, but cacti checked for this.
Linuturk
Posts: 38
Joined: Fri Feb 09, 2007 1:53 pm
Location: Tallahassee, Florida

Post by Linuturk »

I've got the same problem after upgrading using the Ubuntu Gutsy package, but I can't find global.php in /usr/share/cacti/site/include/

Any help?
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

with Debian/Ubuntu, is it under /etc/cacti ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
Linuturk
Posts: 38
Joined: Fri Feb 09, 2007 1:53 pm
Location: Tallahassee, Florida

Post by Linuturk »

Nope, not there either.

I've done a $ locate global.php

and it doesn't show up . . .
GraveR
Posts: 1
Joined: Sat Feb 23, 2008 6:35 am

Post by GraveR »

For Ubuntu Gutsy, the file you're looking for is '/usr/share/cacti/site/include/config.php'

The fix mentioned works.
Linuturk
Posts: 38
Joined: Fri Feb 09, 2007 1:53 pm
Location: Tallahassee, Florida

Post by Linuturk »

Thank you so much. The fix is confirmed to work for me in the file mentioned above :)
petaramesh
Posts: 1
Joined: Sun Feb 24, 2008 3:39 am

Same problem, same fix

Post by petaramesh »

For the record, same problem in Ubuntu Gutsy after upgrading the cacti package yesterday.

Fixed by applying Megaman's fix on /usr/share/cacti/site/include/config.php line 87.

Thanks.
thavinci
Posts: 26
Joined: Tue Nov 06, 2007 12:14 pm
Location: JHB
Contact:

Same Issue Here!

Post by thavinci »

Wel ive got the exact same problem here....
Running on FreeBSD6.2.

megaman's fix worked for me.
sllywhtboy
Posts: 42
Joined: Sun Jul 09, 2006 1:51 am
Location: detroit'ish
Contact:

Post by sllywhtboy »

config.php tweaks in ubuntu edgy didn't work. :(
netmirror
Posts: 1
Joined: Mon Feb 25, 2008 6:45 am

Post by netmirror »

wasca
Posts: 3
Joined: Fri Feb 22, 2008 1:36 am

Post by wasca »

I can confirm that upgrading cacti to 0.8.0.6h on Ubuntu Dapper 6.06 LTS breaks cacti but this fixes it.

edit /usr/share/cacti/site/include/config.php

Look at line 86

Replace this line

Code: Select all

if (!((is_file($_SERVER["SCRIPT_FILENAME"])) && (substr_count($_SERVER["SCRIPT_FILENAME"], $_SERVER["PHP_SELF"])))) {
With this

Code: Select all

if (!((is_file($_SERVER["SCRIPT_FILENAME"])))) {
I had to run through the install process after doing this. All my data was still there.

Hope this helps.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest