Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Upgrade from 0.8.7a to 0.8.7b: 'Invalid PHP_SELF Path'
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Help: Linux/Unix Specific
Author Message
TheWitness
Developer


Joined: 14 May 2002
Posts: 9697
Location: MI, USA

PostPosted: Wed Feb 13, 2008 8:39 pm    Post subject: Reply with quote

I believe the megaman fix to be secure.

TheWitness
Back to top
tymbow



Joined: 14 May 2005
Posts: 48

PostPosted: Thu Feb 14, 2008 12:00 am    Post subject: Reply with quote

Make that 5 people with the problem (except I am on Windows).
Back to top
faustovetter@gmail.com



Joined: 14 Feb 2008
Posts: 1

PostPosted: Thu Feb 14, 2008 12:40 pm    Post subject: Possible workaround without touching the code Reply with quote

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).

Back to top
chronos



Joined: 12 Feb 2008
Posts: 5

PostPosted: Thu Feb 14, 2008 1:01 pm    Post subject: Reply with quote

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.
Back to top
just_me



Joined: 16 Mar 2006
Posts: 1

PostPosted: Mon Feb 18, 2008 8:02 am    Post subject: Reply with quote

Hello!

I have the FreeBSD installation from ports:

I added some debug here:
Code:

                               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.
Back to top
Linuturk



Joined: 09 Feb 2007
Posts: 38
Location: Tallahassee, Florida

PostPosted: Fri Feb 22, 2008 10:17 am    Post subject: Reply with quote

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?
Back to top
fmangeant
Cacti Guru User


Joined: 19 Sep 2003
Posts: 2325
Location: Sophia-Antipolis, France

PostPosted: Fri Feb 22, 2008 10:18 am    Post subject: Reply with quote

Hi

with Debian/Ubuntu, is it under /etc/cacti ?
Back to top
Linuturk



Joined: 09 Feb 2007
Posts: 38
Location: Tallahassee, Florida

PostPosted: Fri Feb 22, 2008 10:25 am    Post subject: Reply with quote

Nope, not there either.

I've done a $ locate global.php

and it doesn't show up . . .
Back to top
GraveR



Joined: 23 Feb 2008
Posts: 1

PostPosted: Sat Feb 23, 2008 6:38 am    Post subject: Reply with quote

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

The fix mentioned works.
Back to top
Linuturk



Joined: 09 Feb 2007
Posts: 38
Location: Tallahassee, Florida

PostPosted: Sat Feb 23, 2008 4:46 pm    Post subject: Reply with quote

Thank you so much. The fix is confirmed to work for me in the file mentioned above
Back to top
petaramesh



Joined: 24 Feb 2008
Posts: 1

PostPosted: Sun Feb 24, 2008 3:42 am    Post subject: Same problem, same fix Reply with quote

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.
Back to top
thavinci



Joined: 06 Nov 2007
Posts: 16
Location: Port-Elizabeth

PostPosted: Sun Feb 24, 2008 5:29 pm    Post subject: Same Issue Here! Reply with quote

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

megaman's fix worked for me.
Back to top
sllywhtboy



Joined: 09 Jul 2006
Posts: 29
Location: detroit'ish

PostPosted: Sun Feb 24, 2008 5:36 pm    Post subject: Reply with quote

config.php tweaks in ubuntu edgy didn't work.
Back to top
netmirror



Joined: 25 Feb 2008
Posts: 1

PostPosted: Mon Feb 25, 2008 6:49 am    Post subject: Reply with quote

Test this solution:
https://bugs.launchpad.net/ubuntu/+source/cacti/+bug/194687
Back to top
wasca



Joined: 22 Feb 2008
Posts: 2

PostPosted: Mon Feb 25, 2008 11:41 pm    Post subject: Reply with quote

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:
if (!((is_file($_SERVER["SCRIPT_FILENAME"])) && (substr_count($_SERVER["SCRIPT_FILENAME"], $_SERVER["PHP_SELF"])))) {


With this

Code:
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.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Help: Linux/Unix Specific All times are GMT - 5 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 



Powered by phpBB © 2001, 2005 phpBB Group