PHP-Nuke: Web Portal System =========================== Unofficial Windows Installation Guide & Support 1.1 Recommended Requirements --------------------------- Windows 2000 Professional Edition with Service Pack 2 and all available patches. (http://windowsupdate.microsoft.com) PHP 4.2.1 for Windows (or latest version) available from http://www.php.net. MySQL 3.23.51 Server for Windows (or latest version) available from http://www.mysql.com. PHPNuke 5.6 (or latest version) available from http://www.phpnuke.org. Apache WebServer for Windows (any version above 1.3.2 seems to work. I am using 1.3.2). http://www.apache.org. 1.2 Notes on Requirements ------------------------- 1.2.1. I haven't got PHP-Nuke to work on Windows XP, therefore I recommend Windows 2000 Professional. It's up to you if you choose to use XP. I don't see why it wouldn't work; perhaps it's just me. 1.2.2. Use the LATEST STABLE versions of PHP and MySQL. There is no substitute for using the latest versions. They may just have fixed the particular bug that is causing you a problem. You could try the latest BETA version if you wish, but these may just cause you more problems. 1.2.3. Use the LATEST PHP-Nuke. Again, your particular bug may just have been fixed in that version. This guide is based around 5.6, so if you can't find something in Nuke that is in this guide and you are using a newer version, chances are it was removed or fixed. 1.2.4. I know, IIS is brilliant, it's integrated into windows, it's excellent with ASP and you have cravings and urges to use it. I suggest you don't. Go with Apache, it worked first time for me without any hassle. IIS seemed to be the cause of most of my problems with PHP in fact. I run two web servers now, Apache for dedicated PHP and IIS for all my ASP and general web site stuff. Apache isn't that difficult to use, there are pointers in this guide. 1.2.5. Please try to use an NT-Based windows. 95/98/ME will probably cause you more problems than it's worth. If you run lots of servers on 95/98/ME you can cause a TCP/IP buffer over-run and then nothing works till you close down everything TCP to free up buffer space. NT/2000/XP are the way to go if you are serious about running a Nuke portal. 1.2.6. Whatever windows you are running, be sure to go to http://windowsupdate.microsoft.com before installing ANYTHING. Get all Critical and Relevant updates for your Windows before continuing. 2.1 Installing Apache --------------------- My particular Apache came with a system called net.db on a PC Plus cover cd (hence why it's so outdated). Wherever your Apache comes from, read the installation and readme files fully before installing and during installation keep them open for reference. 2.1.1. Install your Apache fully (this is the easy bit!). 2.1.2. From your start menu, run Apache or open up a command prompt and type "Apache -s" to start it. Check there are no critical errors after you see the "Apache/1.3.2 (Win32)" message. 2.1.3. Open up your favourite browser and navigate to http://localhost and make sure you see the Apache test message. If you don't see the test message and you are getting an Error 404 or 500, then something went wrong. Read the Apache documentation, visit their support forums, read all the FAQ's on Apache and keep reading and re-installing until it works. 2.1.5. So Apache works? I'm happy for you. Before continuing, if you've never used Apache before, spend some time getting to know it. \htdocs\ in the Apache folder is where your web pages are stored. \conf\ is where configuration files are, etc. These little things are very important. Take the Apache manual to bed on a laptop with you and read it all. Particularly understand "bindings". This will come in handy if you want to run your Nuke as a public website for everyone on the Internet to see. 2.2 Notes on Apache ------------------- 2.2.1. If Apache doesn't work, DO NOT continue your installation of PHP-Nuke until you make it work. You'll only cause more problems in the long run. 2.2.2. Make use of the documentation, forums, etc in solving problems. 2.2.3. Apache is not difficult. Anyone can make it work, especially if you've had a little experience in Microsoft IIS or another web server. Take a deep breath and dive into the manuals for all the info you need. 3.1 Installing MySQL -------------------- It has been said on the Nuke forums that MySQL is the most difficult part of the installation. Not at all, it just takes a bit of time to get to know it, following instructions carefully and everything you want will come to you. 3.1.1. Unzip the "mysql-3.23.51-win.zip" package to a temporary folder and run setup.exe. 3.1.2. For god sakes install it to c:\mysql unless you have a VERY VERY good reason for not doing so. NB: "It messes up my lovely neat filing system" does not count as a VERY VERY good reason. You will probably end up causing yourself more trouble than it's worth if you install it somewhere else. If you do have a VERY VERY good reason for installing it elsewhere, take note of the instructions given in set-up on the first page and do EXACTLY as it tells you to do. Otherwise, just leave well enough alone and accept the defaults :) 3.1.3. Do a custom setup and select all the components. Why? Because then you aren't creating any potential problems by not having a piece of the puzzle in place. 3.1.4. When setup is done, run the program c:\mysql\bin\winmysqladmin.exe. NB: There are no Start Menu shortcuts. You are dealing with Development software here not the latest Lemmings 2004 demo. 3.1.5. (Bit hazy here, I can't re-create this because I've already installed the software) You should see a dialogue asking you to create a username and password. Something simple will do. You will probably set up Nuke to use this username and password later so don't go overly complicated. It depends on how important security is to you. 3.1.6. When you have the main MySQL admin window, head for "Start Check" and make sure all the tabs read 'yes' or 'OK'. At this point, they probably don't so it's time to shut down the MySQL server and restart it. I actually rebooted the computer, just to be complete. You might wanna try the same. 3.1.7. When you return from the reboot, the Admin tool should be automatically started in your system tray. Call it up, and check the "Start Check" again, this time everything should read 'yes' or 'OK'. 3.1.8. Go through the "Variables" and "my.ini Setup" tabs and change any settings you need to. NB: Don't change the bind IP address or port number unless you really need to. You'll only have to change them in Nuke later on if you do. 3.1.9. In the Databases tab, right-click and create a new database. Call this database "nuke". (Unless you have a VERY VERY good reason not to again.) ** We'll return to the rest of the database setup later on. Right now, I wanna talk you through setting up PHP on Apache (after a few notes on MySQL) so that all three of the major parts of this installation are done. Then we can get down to actually nuking with SQL. 3.2 Notes on MySQL ------------------ 3.2.1. Sorry I'm a bit hazy around the time when you first open the WinAdmin console. I can't re-create it as MySQL is installed and I have no intention of un-installing it. Take my advice: Read all the documentation and readme files for help here. (You should have done anyway!!). 3.2.2. Make use of the MySQL support forums and newsgroups for help and installation advice here. 3.2.3. Don't change any defaults unless you really need to. It's better for your health if you just leave it all as it is. It worked fine for me, honest. 4.1 Day 30: Installing PHP! --------------------------- You have reached the fun bit. This is the bit that came up most of the time on the nukesupport forums so do it right now, and you'll never have to see it ever again. (If you do it wrong, you'll have nightmares about "php.ini"). 4.1.1. When you have downloaded php-4.2.1-installer.exe, run it. 4.1.2. Do an advanced setup please. Install PHP to the DEFAULT directory of c:\php\. Same as MySQL, don't move it unless you have a VERY VERY good reason. 4.1.3. Backup replaced files and accept all the default directories. 4.1.4. Enter a valid SMTP server, perhaps your ISP's server. (smtp.freeserve.com for Freeserve users.) Enter a valid from address so that people can reply to mail that your PHP server sends out. 4.1.5. MOST IMPORTANT: Select "Display all Errors and Warnings" only. Don't use the top one which includes notices else you'll end up like all the worried folk I've seen on the nukesupport forums. 4.1.6. You are installing this on an Apache server (if you took my advice). Otherwise, select your server if you didn't take my advice and may god have mercy on your PHPNuke web site for not doing so. 4.1.7. Only associate .php with PHP unless you know that you plan on using older PHP scripts. Install away!!! 4.1.8. When Install is complete, open up notepad and open the file php.ini located in your c:\windows or c:\winnt directory. 4.1.9. Do the following and only the following! engine = On safe_mode = Off error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR display_errors = On log_errors = On register_globals = On cgi.force_redirect = 1 These flags are scattered around the file so you may want to use search. Make sure they are set exactly as I state. NB: If you arn't using Apache as I recommend see section 4.2. 4.1.10. Open httpd.ini located in your apache folder under \conf\. 4.1.11. Add the following lines: (Copy and paste them for accuracy) ScriptAlias /php/ "c:/php/" AddType application/x-httpd-php .php Action application/x-httpd-php "/php/php.exe" They can go anywhere, it doesn't matter that much. 4.1.12. Your done here! In case you had any errors (really, you shouldn't have, you were just configuring) head for www.php.net, check out their forums and read all documentation that comes with PHP. 4.2 Installing PHP Notes ------------------------ 4.2.1. In the configuration, I am telling you to use "E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR". This will show you all warnings. Warnings are the things that will stop your PHPNuke working so I recomend asking PHP to show them as I have done. Other people will tell you to have PHP so no errors or warnings but this seems silly, as you won't be able to track problems. Listen to me :) 4.2.2. Definitely turn off the Notices reporting. Too many people post messages saying they have a string of Notices when they start their PHPNuke. Notices don't harm your PHPNuke, it's the Warnings that do. So, turn off notices as I suggest in your php.ini unless you want your site to look ugly. 4.2.3. Apache/PHP Experts will notice that I am telling you to use the CGI installation of PHP in Apache, not the SAPI installation that requires another big download and a little more work. CGI works for me and there won't be security problems for me because of the way my system is set-up. Other people may want to try the SAPI setup for more security. If you do, read the "install.txt" file included in your c:\php\ folder. It's just that I know CGI works and won't cause me any problems. Over to you though. 4.2.4. "register_globals = On" - The most important flag in the world, if this is set Off you can kiss goodbye to a working PHPNuke installation right now. I understand it was set on by default in Linux hence why it was never documented. Us poor Windows peeps have to do a little more work in Notepad to switch it on. 5.1 Installing PHPNuke! ----------------------- You've done it; you're on the home run now. If you followed all my instructions you can look forward to a working Nuke installation after this section with no problems. Let's get on with it... 5.1.1. When you have your "PHP-Nuke-5.6.tar" file, unzip it. 5.1.2. Open the command prompt and navigate to the directory where you just unziped the file. When you are there, change to the \SQL\ directory. 5.1.3. Insure you created the database as described in 3.1.9. Type the following "c:\mysql\bin\mysql.exe nuke < nuke.sql" 5.1.4. After a little churning, you should be returned to the prompt. Open up the MySqlAdmin program again, under the Databases tab click on your "nuke" database. 5.1.5. You should see the database populated with tables, e.g. nuke_users, nuke_news. (Do those exist? I dunno, just an example.) 5.1.6. Now, copy everything in the "PHP-Nuke-5.6.tar\html" directory to the "htdocs" directory in your Apache folder. You may want to create a new directory in "htdocs" to store your nuke web site or you may want to dump them directly into the htdocs root. It's up to you. 5.1.7. Edit the config.php file in your nuke directory (or htdocs root). Edit it completely, read the whole document, do exactly as it says or you'll cause more trouble for yourself. Set $dbuname = ""; $dbpass = ""; to the username and password you created in SQL. (These are CaSe SeNsAtIvE). 5.1.8. Make sure Apache server is running and goto the address of your nuke site. (http://localhost or http://localhost/nuke or something like that). You should see your nuke home page without any warnings. 5.1.9. Head for /admin.php on your nuke site and create a brand new SuperAdmin username and password for yourself in your nuke site. Once you click submit you should be presented with a login page to login as administrator to your nuke site. You're done!! 5.2 Installing PHPNuke! ----------------------- 5.2.1. Don't see any tables in your "nuke" database after you type the command line? Open up "nuke.sql" in Notepad and check that this line reads exactly as I have it below: # Host: localhost Database: nuke #-------------------------------------------------------- 5.2.2. If you changed your database name way back at the MySqlAdmin console, (silly!) make sure that name change is reflected in the Database name line above. 5.2.3. If you are still seeing SQL Warnings when you go to your nuke home page, see Troubleshooting next. 6.1 Troubleshooting ------------------- *grrrrrrrr* did you not follow my instructions? *sigh* read on, let's see if we can help you. NB: If you opened this document and came straight here, you can't just use this bit to help you out, you need to read the whole document. Sorry, no quick fixes for PHP. It's a developer's world. 6.1.1. Try this: in the config.php file, check there are no spaces before or after the "". If you find spaces, delete them and save the file. Sorry, but if you do find them, you need to check EVERY .php file. This fix was suggested on the nukesupport forums, I didn't encounter this problem so I don't know if it works or not but try it anyway. 6.1.2. Seeing SQL errors? Try this: find $dbtype = "MySQL"; in the config.php file. Change MySQL to mysql. (Uppercase to lowercase. Then, in the \includes folder, open up "sql_layer.php". Do a find and replace, find all MySQL's and change them to mysql's lower case as before. Again, I didn't encounter this problem. Suggested at nukesupport forums. These are the only two major problems I can find that may cause you a problem. Still more problems? Read the PHP install guide again, read the MySQL install guide again, read the Apache install guide again, then read the PHPNuke install guide again, then read this document again. Then, after all that read and search through the forums at nukesupport.com. Finally, if you are still having problems, post a message to the nukesupport.com forums. 6.2 Nukesupport Forums ---------------------- If you are posting to the nukesupport forums, use this little template to help you out. If you don't include these details, people may get mad. The more information you give them, the more help you may get back. ----------------------------------------------------------------------------------- Dear all, I am having trouble with PHPNuke 5.6. I am wondering if anyone can help me. My set-up is as follows: I have fully read all the documentation, I have read Lawrence Stromski's PHPNuke for Windows guide and I have searched this forum for information but still my problem keeps coming up. My problem is as follows: These are the warnings and/or error messages I get: I have tried the following things besides what is in the documentation and Lawrence's guide to solve my problem: Here is my php.ini/mysql.ini/httpd.ini/config.php configuration files: Thanks in advance for your help. From . ----------------------------------------------------------------------------------- If you don't get any replies to your message, changes are you might have a genuine bug on your hands. Then it's time to write to Francisco Burzi with your problem. Visit www.phpnuke.org for details on submitting bug reports. 7.1 A Quote ----------- Open source software is not equal to a free immediate qualitive reply to each question; it is about sharing and openness, and searching before posting, and sometimes rephrasing to make yourself clear. It does not look like a good concept, it is a good concept, but not for people who think the whole world is at their feet. -marq. 7.2 Credits for this Document ----------------------------- henkwie - "