PDA

View Full Version : PHP Nuke screwed (Here's the Fix)?


Tri_3Dent
1-29-03, 04:27 PM
Is php broken or something?
check out my site.... http://www.wc3net.com/index2.php

It was fine yesterday when I went to bed. Then I woke up and saw all the weird messeges. My friend said it was fine this morning. We did not change anything on our website.

EDIT: I also uploaded the backup just now and it still didn't work.

bdoc
1-29-03, 04:33 PM
If your on charon they just upped php to 4.3 - which kind of frontend are you using for your site?

Php must be working for you to some extent if your Invision board is working ok.

Jade Dragon
1-29-03, 04:38 PM
If you are running PhpNuke you will need to make and adjustment to a couple strings check out http://pownuke.com for the fix.

JD

Tri_3Dent
1-29-03, 04:42 PM
i don't think i'm using phpnuke...
Our invision boards seem to be working fine but our main site isn't working... we just use simple php codes like

include("http://www.wc3net.com/right.php");

and like.....

$news = "http://www.wc3net.com/invision/ssi.php?a=news&show=5";
$extension = ".php";
$email = "webmaster@wc3net.com";

if(empty($page)) {
include($news);
} elseif(file_exists($page."$extension")) {
include($page.$extension);
} else {
print ("
<br><b>404</b><br>Sorry but this page does not exist. Click <a href=\"index.php\">here</a> to go back to the main page. If you have any question email the webmaster <a href=\"mailto:$email\">here</a>.");
}

alphadesk
1-29-03, 04:52 PM
Tri_3Dent,
You are on space and php has been updated on that server. http://space.powweb.com/phpinfo.php/

Don't know if this has caused the problem or not. LexF will probably answer shortly.

Tri_3Dent
1-29-03, 05:14 PM
i hope someone can help me...
i barely know anything about php.. it's just the designer designed it using php. I just know basics but I need to know what to change in code so it works with the new version.

LexF
1-29-03, 05:26 PM
As others have suggested, I believe you are running phpnuke. You or your web designer will need to make those changes that jadedragon has pointed out. See her stellar http://pownuke.com/ site for the details.

Tri_3Dent
1-29-03, 05:37 PM
I was searching the phpnuke site and it says something like this:

Download a copy of phpNuke.
- extract it into a local folder on your computer

Uploading to your Site
- open your FTP program
- Upload all contents inside of the "html" folder to either your htdocs folder (if you want your whole site to use nuke) or into a folder of your choosing. The folder can be named anything you want.


The did not give the designer access to the FTP, all he did was send me the whole website thing. So I believe he did not use phpNuke.

EDIT: What is phpNuke anyway??

clizon
1-29-03, 05:47 PM
I am on IO and my PHP is now screwed as well. PHP Nuke as well. I'll have a look at the link for the fix....


Okay....updated and it worked, fixed the problem. I feel much better now!

Tri_3Dent
1-29-03, 06:02 PM
what did you fix?

alphadesk
1-29-03, 06:09 PM
Tri_3Dent,

Look for these two files and make the changes.

mainfile.php line 565
blocks/block-Old_Articles.php line 58 use the following code:

setlocale ("LC_TIME", "$locale");

You need to remove the quote marks to still a deprecated error from filling up the logs.

setlocale (LC_TIME, $locale);

Tri_3Dent
1-29-03, 06:20 PM
I don't have mainfile.php
Also, i don't use phpnuke!!

Most of the php code connects with the invision forums.

clizon
1-29-03, 06:29 PM
I use PHP nuke and those were the files I fixed. As an update Alpha, I also had to update the index.php in my downloads and weblinks modules.

My PHP BB was unaffected.

Tri_3Dent
1-29-03, 06:33 PM
ok i asked my friend he said phpnuke is like a portal thing. He said we're not using that. So it must me the PHP code or some coding in Invision Boards...

alphadesk
1-29-03, 06:37 PM
Thanks clizon,I also had to update the index.php in my downloads and weblinks modules.I'll make sure Jade gets that added to the pownuke site.

LexF
1-29-03, 06:38 PM
Okay Tri_3dent...

It looks like the errors on your page are caused by problems handling streams. You're going to have to call in your developer. Of interest to him will be the modifications in PHP 4.3.0 to stream handling:

http://www.php.net/release_4_3_0.php

LexF
1-29-03, 06:43 PM
I figured out what's wrong, and I've started the fixing portion.

PHP 4.3.0 isn't letting you use

include("http://www.mysite.com/subfolder");

You have to just use

include("subfolder");

See how my changes affected things at

http://w3cnet.com/indexlex.php

I didn't change all references, but I started the process.


Edit: Not in all cases. Something is wonky with this script, that's not surviving the upgrade. I couldn't find info on invision's site. My attempts to correct the problems are coming along, but far from complete.

mloradites
1-29-03, 06:58 PM
well this was kind of serendipitous, my site was working fine earlier today i read this thread about 5 mins ago and go look at pownuke, then just for my regular check on my site go and the error shows up! i think the fates like me today! thanks for the help!

Tri_3Dent
1-29-03, 07:17 PM
well that helped a bit. Now the login and the right affiliates/top site part works after i changed to include("right.php");
But the middle part isn't work even though i removed the http://www.wc3net.com part.

I think it doesn't work because the middle part have extra variables like

include("invision/ssi.php?a=active ");

http://www.wc3net.com/index2.php
Can someone help me on this?

LexF
1-29-03, 07:19 PM
For the include paths to URLs with variables, you have to keep the whole URL.

As in: 'http://yourdomain?a=this'

in includes with variables after ?.

Tri_3Dent
1-29-03, 07:21 PM
It's the same error as before then. I changed the middle back to the full URL.

include("http://www.wc3net.com/invision/ssi.php?a=active");

Still isn't working :(
http://www.wc3net.com/index2.php

1337hax0r
1-29-03, 08:42 PM
my site also doesnt work my .inc keeps on poping up the same thing. my site is www.im-d.com if u want to look and c whats wrong i messed around with it so it might be a lil messed up

Jade Dragon
1-29-03, 11:37 PM
Hey all, I think I stumbled on to something. :)

http://pownuke.com/test/includes.php


Test #1
<?php

if (file_exists('../test/test.htm')) {
include('../test/test.htm');
} else {
echo "<center>\"Not yet\"</center>";
}
php?>
<br>
Test #2



<?php

include('../test/test.htm');

php?>
<br>
Test #3

<?php
$httpfile = file_get_contents("http://www.drazan.biz/test/test2.htm");

echo " $httpfile";


php?>

Test #3 refers to a new set of Functions defined in PHP 4.3.0

found this at Php.net
http://www.php.net/manual/en/ref.stream.php

Little bit of testing and the above works. :)

LexF is this what we need to do now for including content from another source?

Still experimenting with a couple strings to see if I can get a dynamic path.

JD

Jade Dragon
1-29-03, 11:45 PM
Dynamic Path string.

Test #4

<?php
$path = ("http://www.drazan.biz");
$httpfile = file_get_contents($path . "/test/test2.htm");

echo " $httpfile";


php?>

Refering code from page at php.net

<?php
/* Read local file from /home/bar */
$localfile = file_get_contents("/home/bar/foo.txt");

/* Identical to above, explicitly naming FILE scheme */
$localfile = file_get_contents("file:///home/bar/foo.txt");

/* Read remote file from www.example.com using HTTP */
$httpfile = file_get_contents("http://www.example.com/foo.txt");

/* Read remote file from www.example.com using HTTPS */
$httpsfile = file_get_contents("https://www.example.com/foo.txt");

/* Read remote file from ftp.example.com using FTP */
$ftpfile = file_get_contents("ftp://user:pass@ftp.example.com/foo.txt");

/* Read remote file from ftp.example.com using FTPS */
$ftpsfile = file_get_contents("ftps://user:pass@ftp.example.com/foo.txt");
?>



:)

JD

clizon
1-29-03, 11:51 PM
As a further update, for PHP Nuke users, it also hits your Webmail section. Same fix for the quotes around 'local' applies.

Jade Dragon
1-29-03, 11:55 PM
PhpNuke users! keep the updates coming in for file fixes. I'll try to update the notice on pownuke tomorrow with all the changes.

Thanks for the heads up! :)

JD

LexF
1-29-03, 11:57 PM
JD,

Nice work. Still not a real include, though, on the last test.

Some users want to use includes that pass variables as part of the include string, ie:

include "http://mysite.com/index.php?variable=content";

Getting the contents isn't exactly the same as including.

But for some reason, includes of URLs aren't working as expected, where "as expected" is like this example from php.net:

<?php

/* This example assumes that www.example.com is configured to parse .php *
* files and not .txt files. Also, 'Works' here means that the variables *
* $foo and $bar are available within the included file. */

// Won't work; file.txt wasn't handled by www.example.com as PHP
include 'http://www.example.com/file.txt?foo=1&bar=2';

// Won't work; looks for a file named 'file.php?foo=1&bar=2' on the
// local filesystem.
include 'file.php?foo=1&bar=2';

// Works.
include 'http://www.example.com/file.php?foo=1&bar=2';

$foo = 1;
$bar = 2;
include 'file.txt'; // Works.
include 'file.php'; // Works.

?>

Jade Dragon
1-30-03, 12:17 AM
I get the variable structure, however that wasn't quite my post. :)

When I changed servers from callisto to the new one, my path variables have this error...


Warning: main(http://www.bjerkefamily.com/wggfiles/textures/green/textures.html) [function.main]: failed to create stream: HTTP request failed! HTTP/1.1 404 Not Found in /www/u/user/htdocs/wgg/texturesgreen.php on line 158

Fatal error: main() [function.main]: Failed opening required 'http://www.bjerkefamily.com/wggfiles/textures/green/textures.html' (include_path='') in /www/u/user/htdocs/wgg/texturesgreen.php on line 158



same as if I use this code.
<? include('http://domain.tld/file.html'); ?>

being that I am calling from a different source wouldn't I want to use the "get contents" as I can't seen to define a path other than relative using the "include". I'm not calling a vaiable just using a "fileserver" setup.

??

JD

somersetbrad
1-30-03, 01:08 AM
your substitute for the Include is a good work around.

however I did not se a way that you could work this with it.

Example
<? include('file.html'); ?>


I found this to be a huge problem that kept me from editing my index page in root
and paste,paste, paste into each Sub Directory.

:) I am one of those UBer lazy guys (But it pays off when you have a site with tons and tons of pages)

Any How if anyone can figure out

a. how to pass the variables correctly

and

b. do a current directory include without specifing a specific path.


I would love to see how you pulled it off.


P.S. Powweb.... I really wish you guys would get a "testing Server"

P.S. Powweb..... Please inform me if my site is on it :)

LexF
1-30-03, 01:32 AM
Note from CTO James:

There were two problems I have found, fixed, and everything will be okay once we reinstall php on all the machines.

I needed to update the php.ini file, and I also had to use the next oldest version of Zend Optimizer. For some reason the newest verion caused some issues...

What this means for you: Machines that have PHP 4.3.0 will get it reinstalled. Machines still on 4.2.3 will be upgraded soon. And the Zend Optimizer will go back one version, until Zend releases some fixes.

somersetbrad
1-30-03, 01:50 AM
Great Thanks for the update.. It is wonderful to see other people are not sleeping :)

Keep hackin at it guys. I will not worring about bringing my other sites to "work around" Standards then :)

Please inform us if ya run into a problem :)

ciscokid
1-31-03, 11:53 AM
Now I made the changes for the Locale issue with PHPNuke. All was working till this AM. Now when I login as admin on my sites hosted on Neptune I can't do a thing everytime I click on an Icon to do someting I get the admin login screen again and again and again.

Help I know that neptune was upgraded to PHP 4.3 yesterday. All else seems to work fine and there is no error logs or messages.

ciscokid
1-31-03, 05:36 PM
Not all is working fine after all. the downloads are not working all users get is a blank page.

I put a temp fix up but I want my PHPNuke back.

Tri_3Dent
1-31-03, 05:42 PM
hmm... well it WORKS better before but still having problems with this.

http://www.wc3net.com/

if you go there, there is only ONE news topic. The coding is already done to show 5 topics out of the forum. If you refresh it, the news content changes.

Again as before, we have not touched anything and still doing this. Our site was starting to grow big and now this problem comes!! :mad:

mikem
1-31-03, 10:19 PM
What a JOKE!!!

Ok here's my sites
http://www.fauxpas.org
on www01.powweb.com
and my subdomain
http://phpbbport.fauxpas.org

Both screwed.
The LC_TIME fix is a fix for if you are getting the below error.
Warning: setlocale() [function.setlocale]: Passing locale category name as string is deprecated. Use the LC_* -constants instead.

Which I was getting yesterday. I fixed the LC TIME in a couple of files on my php-nuke sites. Everythign was fine.
It try both sites today and you all can see by visiting the links what I get now.
I am not going to fix this crap, POWWEB IS! or they can expect a very crappy letter from me and a demand of my hosting payment refunded.
This is ridiculous.

So all these little fixes you guys are scrambling to apply to get your sites working again? Why? Powweb states in their Announcements there is some problems and errors with PHP 4.3. DUH! and appareantly they are working to fix it.

I didn't pay for this kind of hosting I'm sorry if I sound like a disgruntled customer, but I am. I have had to have powweb move my site 2 times since I signed up with them.
First time, I was on callisto and you all remember the problems they had with callisto? geesh. So they moved me to mars. Then the recent problems with mars. Now this.
Granted I got 6 months of free hosting, but BIG DEAL! I would rather have a WORKING SITE than the friggin free hosting. I can get free hosting at tripod(I'd rather not)..geesh.
I really hate venting like this, but I'm fed up...I didn't tell them to install php 4.3.

Hey POWWEB!! Ever heard of testing a program before you try it on LIVE servers? Hello???
I'm sure you did, but did you test it with a popular CMS like Nuke??

mikem

somersetbrad
2-1-03, 01:42 AM
Dude what do you see when you FTP into your account?
are there still files there?

mikem
2-1-03, 08:49 AM
Originally posted by somersetbrad
Dude what do you see when you FTP into your account?
are there still files there?

Yes everythign is there. Powweb has got most of it working now. We are down to one error.

Warning: (null)() [ref.outcontrol]: output handler 'ob_gzhandler' cannot be used twice in Unknown on line 0

Here's some reference on the error.
Note: When upgrading from PHP 4.1 (and 4.2) to 4.3 that due to a bug in earlier versions you must ensure that implict_flush is OFF in your php.ini, otherwise any output with ob_start() will be not be hidden from output.

The Output Control functions allow you to control when output is sent from the script. This can be useful in several different situations, especially if you need to send headers to the browser after your script has began outputting data. The Output Control functions do not affect headers sent using header() or setcookie(), only functions such as echo() and data between blocks of PHP code.

Requirements
No external libraries are needed to build this extension.

Installation
There is no installation needed to use these functions; they are part of the PHP core.

Runtime Configuration
The behaviour of these functions is affected by settings in php.ini.

Table 1. Output Control configuration options

Name Default Changeable
output_buffering "0" PHP_INI_PERDIR|PHP_INI_SYSTEM
output_handler NULL PHP_INI_PERDIR|PHP_INI_SYSTEM
implicit_flush "0" PHP_INI_PERDIR|PHP_INI_SYSTEM

mikem
2-1-03, 09:15 AM
If running PHP-Nuke, to fix the above error I posted if you see it on your site.

Find in mainfile.php
ob_start("ob_gzhandler");

and comment it out.

mikem

ciscokid
2-1-03, 11:54 AM
Thanks Admins all seems to be working with a few little errors but that is just a little cleanup

The wife is happy and that's what counts:D :D :D

mikem
2-1-03, 12:06 PM
Originally posted by ciscokid
The wife is happy and that's what counts:D :D :D

ain't that the truth.

off topic:
Man's secret to marriage.
"You can be right or you can be happy, you can never be both. So pick one."

mikem

clizon
2-1-03, 12:48 PM
I am now getting this error on my site

Warning: (null)() [ref.outcontrol]: output handler 'ob_gzhandler' cannot be used twice in Unknown on line 0

www.nfcclan.com/phpnuke/html/


Help!!!!!!!!

mikem
2-1-03, 01:02 PM
Originally posted by clizon
I am now getting this error on my site

Warning: (null)() [ref.outcontrol]: output handler 'ob_gzhandler' cannot be used twice in Unknown on line 0

www.nfcclan.com/phpnuke/html/


Help!!!!!!!!

read my post a couple 2 or 3 posts above yours.

mikem

VTX
2-2-03, 06:22 PM
I am using PostNuke and my site is still down. I hear word about fixes for phpnuke but not anything for postnuke. Are they similiar enough to wear the fixes will work for both?

www.vertigox.com

hammondhill
2-3-03, 06:29 PM
Originally posted by VTX
I am using PostNuke and my site is still down. I hear word about fixes for phpnuke but not anything for postnuke. Are they similiar enough to wear the fixes will work for both?

www.vertigox.com

Try the fix here (http://news.postnuke.com/modules.php?op=modload&name=News&file=article&sid=2282).

Hope this helps!

VTX
2-5-03, 01:26 AM
Still having problems determining what line to comment out.

Would upgrading to a newer version of post nuke work? Or would that just cause more problems?