Making phpBB2 working with PHP5

September 20, 2005 Add Comment

Making phpBB2 working with PHP5

Officially, phpBB 2 (as of this writing, up to version 2.0.17) is not supporting PHP 5. If you install PHP 5, and use it to run phpBB, you will encounter the following symptoms and errors:

You cannot post message – When you want to post new topic or reply to a topic, after writing your message, when you click “Submit”, a blank page or screen or error message is shown with address bar showing posting.php, instead of posting confirmation message.
You unable to search – When you want to search by clicking oh “Search”, no search results are been returned, or a black page or screen, or error message is shown.
To enable PHP 5 to work properly with phpBB, some changes to the phpBB source code needs to be done. Just follow steps as below:
OPEN
admin/admin_ug_auth.php
FIND
if( $forum_access[$i][$auth_field] == AUTH_ACL && isset($change_acl_list[$forum_id][$auth_field]) )
REPLACE WITH
if( $forum_access[$i][$auth_field] == AUTH_ACL && isset($change_acl_list[$forum_id]) )
FIND
( !isset($auth_access[$forum_id][$auth_field]) && !empty($change_acl_list[$forum_id][$auth_field]) ) ) ||
REPLACE WITH
( !isset($auth_access[$forum_id][$auth_field]) && empty($change_acl_list[$forum_id][$auth_field]) ) ) ||
Finally, some changes are needed so that functions that get called with functions as parameters are not called ‘by reference’ with functions:
OPEN
includes/functions_post.php
FIND
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length)
REPLACE WITH
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length)
OPEN
includes/functions_search.php
FIND
function clean_words($mode, &$entry, &$stopword_list, &$synonym_list)
REPLACE WITH
function clean_words($mode, $entry, &$stopword_list, &$synonym_list)
FIND
function split_words(&$entry, $mode = ‘post’)
REPLACE WITH
function split_words($entry, $mode = ‘post’)
For the above, the changes involved are some parameters have been stripped off the “&” sign.

Check Oracle Version

September 17, 2005 Add Comment

Check Oracle Version

here are several ways where you can query or retrieve the version number of installed Oracle products:

1. If you just want to check the version information of the Oracle database, simply connect and login to the Oracle database with SQL *Plus. Upon login, you will see:

SQL*Plus: Release 9.2.0.6.0 – Production on Tue Oct 18 17:58:57 2005

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.6.0 – 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 – Production

The first italic number is the version of the SQL*Plus client and the second italic number is the version of Oracle database which you are connected to .

2. Retrieve the version information from v$version table by using SQL*Plus. In this table you can find version information on Oracle, PL/SQL, etc.

To retrieve the version information for Oracle, you execute the following SQL statement:

select * from v$version where banner like ‘Oracle%’;

It should return something like this:

Banner
————————————————————————————–
Oracle9i Enterprise Edition Release 9.2.0.1.0 – 64bit Production

3. Version information can also be checked from Installed Products from the Oracle Universal Installer. It will tells you what products is installed on the machine and also its version information too.

In Unix, the installer is located at $ORACLE_HOME/bin/runInstaller.
In Windows, access the installer by Start -> All Programs -> Oracle Installed Products -> Universal Installer.

Install, Setup and Configure CGI and Perl in Windows XP

September 16, 2005 Add Comment

Install, Setup and Configure CGI and Perl in Windows XP

Prerequisite
Obviously, a web server needs to be running on the Windows machine. Refer to this post for instructions on how to install Apache2 in Windows.
Download Active Perl
Download Active Perl from http://www.activestate.com/Products/ActivePerl/?mp=1. Click on Free Download to start the download process. There is no need to input any contact info. Just leave it blank and press ‘Next’ to start the download.
Then download the latest version of Windows MSI package.
Install Active Perl
Start the installation by double clicking the setup file. Follows the on-screen instruction. If you will be using Perl CGI programs and want to maintain some level of portability between both Linux machines and Windows machines, you may want to install Perl at the same location on your Windows machine as it is on most Linux machines.
For example, on Linux machine, Perl is located at /usr/bin/perl and so every Perl program that I write begins with #!/usr/bin/perl. So, it’s best when install Perl on an Windows machine, instead of installing it in the default location (i.e. C:\perl), install it in C:\usr instead, so that the Perl executable is located at /usr/bin/perl. This allows codes written on Windows machine been moved to, without changes, to Linux machine, and have it run there, and vice versa.
To change the installation path, click on browse button when you’re on the installation screen that prompts you to select which features you want to install. Set it to C:\usr\ if needed.
Make sure that the following options is checked (selected):
Add Perl to the PATH environment variable
Create Perl file extension association
Activating CGI
Open the httpd.conf file for editing by selecting Start > Programs > Apache HTTP Server > Configure Apache Server > Edit the Apache httpd.conf Configuration File. Alternatively, open the httpd.conf with any text editor.
In the main directory section, search for Options Indexes FollowSymLinks (at about line 267), and add ExecCGI to the end so it looks like:
Options Indexes FollowSymLinks ExecCGI
Search for the following line and remove the hash mark character (#) to uncomment this line. (You can also change .cgi to .pl, or add .pl behind .cgi if you prefer that perl extention is also treated as cgi files) For example:
#AddHandler cgi-script .cgi
Should look like:
AddHandler cgi-script .cgi .pl
or
AddHandler cgi-script .pl
or
AddHandler cgi-script .cgi
Save the httpd.conf configuration file, restart the Apache server. Test the configuration as described in Testing Your Web Server CGI Configuration at the end of this article.
Optional: Enabling CGI in Any Directory
If you want to use CGI outside Script Aliased directory (Script Alias is usually the Apache2/cgi-bin/), comment out the following line:
ScriptAlias /cgi-bin/ “C:/Program Files/Apache Group/Apache2/cgi-bin/”

Should look like:

#ScriptAlias /cgi-bin/ “C:/Program Files/Apache Group/Apache2/cgi-bin/”

Alternatively, if you want to specify just one directory to put all your cgi programs, change the path instead, but makes ure that directory exists.

Should look like (for default settings):

ScriptAlias /cgi-bin/ “your_prefer_cgi-bin_direcotry”

Save the httpd.conf file. Restart the Apache server.
Finding Perl Executable Location
If you don’t know where is perl.exe installed to, go to Start -> Search and search for perl.exe. This location is the path to the perl executable that has to be put on the top of all cgi scripts. If you follow default installation procedure, the path should be C:/perl/bin/perl.exe
For the path to perl.exe path, all of these format are valid:
#!c:/perl/bin/perl.exe
#!c:/perl/bin/perl
#!/perl/bin/perl.exe
#!/perl/bin/perl
Testing Your Web Server CGI Configuration
Save the following test script in your DocumentRoot directory (if you have uncomment ScriptAlias, you can put it anywhere inside your DocumentRoot directory, or if you have set ScriptAlias to some particular directory, put the cgi in that directory only, i.e Apache2/cgi-bin) as test.pl or test.cgi (depending on your configuration of the AddHandler line) and modify the first line as required to point to your ActivePerl interpreter:
#!c:\perl\bin\perl.exe
# ^^^ this must be the first line of the script! ^^^
# start code
use strict;
use CGI;
my $q = new CGI;
# print header and start the markup output
print $q->header( “text/html” ),$q->start_html( “hello from perl cgi!” );
print $q->h2(“hello dave…”);
print $q->end_html;
# end code
Now go to http://localhost/cgi-bin/test.cgi (scripts in Apache2/cgi-bin/ are read as http://localhost/cgi-bin/ by default). You should see a page that displays a level two heading with the following text:
hello dave
If you see the above message, CGI is running. If you get a 500 error, go to the last entry in your Apache2/logs/error.log (or the Review Error Log in the Start menu) to see exactly what caused this error.