Previous Thread
Next Thread
Print Thread
Hop To
Anonymous
Unregistered
Anonymous
Unregistered
Here is what I have found to be able to run WWWThreads on PHP 3, all the modifications you need to do :

1) In PHP 3, all functions must be declared BEFORE they are called. So, in some files, you need to move the functions at the top of the file. For example, in postlist.php, the show_replies function.

2) In PHP 3, you must have all variables defined into a function since PHP 3 does not support variable number of parameters to a function. The easy fix to that is to add, for example, in the function declaration = "" to variables that might not have any value on the call. For example, in main.inc.php, the send_header function, the $user setting should be $user = ""

3) In PHP 3, the "array_push" function is not available (used in addpost.php and modifypost.php, and maybe others). A workaround for PHP 3 is to replace :
array_push ($words, $line);
by
$words[count($words)] = $line;

4) In various places, arrays statements have a "," after the last value entry - PHP 4 does not mind, but PHP 3 does. Remove the "," after the last entry.

5) All "require" entries for language files produces an error. But this may be only on my host since the "require" adds automatically the first portion of the path which gives a wrong directory for the file at the end --- so with require, I must use relative path. While with "include" I can make absolute path reference. But, it might be a host configured issue. To make it work, I modified all "require" for languages files to "include", and removed the "$config[path]/" at the beginning of the file reference.

That is all I remember that I had to do to make it work with PHP 3... there might be others changes that I did but I do not remember.

Suggestion: Put a blank "index.php" into each language directories. Currently, someone could see the directory listing of all languages directories since it is not protected by a cgi-bin directory.

So, it's possible to be running the snapshot under PHP 3, but you need to modify most of the files in order to do so.

Anonymous
Unregistered
Anonymous
Unregistered
If I might make a readablility recommendation. Step 1 that you mentioned would really help out.

Anonymous
Unregistered
Anonymous
Unregistered
That's brilliant. Thank you so much. I'll save this for when I'm ready to make the switch and will probably be back with more detailed questions.

<img src="http://www.amdragon.com/images/eileensig.gif" alt=" - " />

Anonymous
Unregistered
Anonymous
Unregistered
Thought Scream posted that. Hrm. I recommend that to Scream.

Joined: Jun 2006
Posts: 9,242
R
Former Developer
Offline
Former Developer
R
Joined: Jun 2006
Posts: 9,242
Ok, I've got all of these changes in place except for number 5. What I am going to do on that one is just drop the absolute path reference, and go with a relative one. Haven't done this yet, but I'll have it done by this evening. So at that point if anyone wants to try setting up the snapshot under php3 I would be very interested to hear if there are any other problems.

--- <test>
Scream
Posted from the PHP Port Site (Post might be quirky)


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
IMG Options
by mmem700 - 06/12/2021 10:14 AM
Custom Island database updates
by Pak Chan - 06/09/2021 2:11 PM
PHP 8 support + which php engine is used in IIS?
by luket - 06/08/2021 7:05 AM
7.7.5 Update error
by ECNet - 05/30/2021 8:08 PM
Re: Custom Island Questions
by ECNet - 05/30/2021 5:00 PM
Who's Online Now
1 members (Ruben), 61 guests, and 97 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
gallery test
gallery test
by Mors, September 23
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 7.7.5