PDA

View Full Version : windows installation help


fcollman
08-08-2005, 02:41 PM
I this weekend I've been trying to install pixelpost on my new windows webserver machine and I came across a number of issues... some of which I have sorted out.. others which still leave me confused.

first my photblog is located at http://fcollman2.student.princeton.edu/photoblog/

my general info is:
PHP-version 5.1.0b3 (Pixelpost's min requirement: PHP version 4.3.0)

MySQL version 4.1.13a-nt (Pixelpost's min requirement: MySQL 3.23.58)

GD-lib bundled (2.0.28 compatible) with JPEG support

Server software Apache/2.0.54 (Win32) PHP/5.1.0b3

EXIF Pixelpost is using exifer v1.5 for EXIF information.

Paths
Guessed imagepath: C:/Program Files/Apache Group/Apache2/htdocs/photoblog/images/

Configured Imagepath C:/Program Files/Apache Group/Apache2/htdocs/photoblog/images/

Image Directory: OK - Can we write to the directory? YES.

Thumbnails Directory: OK - Can we write to the directory? YES.

Language Directory: OK

Addons Directory: OK

Includes Directory: OK

Templates Directory: OK
-----
When I first installed pixelpost I was able to get onto the admin section but the main page was blank. I looked around, discovered a few things weren't configured right in php.. i had to load some extensions that weren't loaded .. ie php_exif, php_gd2, and php_mbstring. I did that and still got a blank page and in the admin section i wasn't getting any thumbnails. I configured PHP to show me errors in a logfile and discovered a bunch of errors.. most of them were the undefined variables warnings like PHP_SELF which i take aren't a big deal, but I also got some errors.. for instance it didn't like all the lines like this in functions.php and in cropimage12.php
$ext = strtolower(end(explode('.', $image_path)));

saying that you could only pass variables as references... i did a little googling and deduced that the problem was nesting all those functions like that.. http://propel.phpdb.org/trac/ticket/71 . so i took the explode statement out, made it return to some other variable then stuck it in.

It also didn't like
define(IMAGE_BASE, "../images");
$image_path = IMAGE_BASE . "/$file";
apparently
define("IMAGE_BASE", "../images");
$image_path = IMAGE_BASE . "/$file";

is the way that it is suppose to be used according to php's website... (http://www.php.net/define) maybe this changed in the latest version? or the windows build is less forgiving than the other builds?

So after I fixed those problems I was able to get thumbnails in the admin section but still no front page. So i turned my attention to the index.php page.. which apparently wasn't generating any errors but I still was getting not page. So working my way through the code I figured out the variable $tmp was basically storing the whole page and the code replaces the tags and inserts things as you go. So i started trying to probe $tmp to see what was going on.. and boom.. as soon as I put in a random echo $tmp statement in the code i started seeing the page, of course with some things not replaced yet when i had it to far up. So i tried moving it down and down, and eventually I got everything displayed, but it has the "Thank you for visiting and taking the time to comment on a picture. Please click to be transferred back." message at the bottom. This is obviously a hack.. and I was hoping some people who have a better idea what is going on with the code could help me figure out what's wrong.

I put the orginal index.php as index2.php in the same directory so you can see that it is indeed not working.

oh.. and one other thing.. in the exifier code, if the server isn't configured to allow short tags than it spews out half of the exifier code instead of the page... there's no reason exifier shoudln't just use a <?php tag instead of <?.. its just another way to have something break in a confusing way for people.

fcollman
08-08-2005, 04:51 PM
hmm... poking around some more i discovered the index2.php was creating errors... which is funny cause i was looking for an error log file before and it wasn't making one. In any case, there was another one of those nested function calls that I didn't catch.. namely

796:$ftype = strtolower(end(explode('.', $file)));

which i changed to
796:$dotarray=explode('.', $file);
797:$ftype = strtolower(end($dotarray));

and now it works perfectly.... i take it this is some difference in php/apache on windows or something about the way i have php configured.

i've now swapped my hacked version of index.php to index2.php and the edited version of the original back to index.php.

riken
08-09-2005, 12:04 AM
PHP-version 5.1.0b3 (Pixelpost's min requirement: PHP version 4.3.0)
Pixelpost is not compatible with PHP5. Downgrade to PHP4 and try again.

AndyK
08-09-2005, 12:23 AM
Also, running Apache 2.xx/PHP/MySQL is not recommended in a Windows production server environment. Better to use Apache 1.xx. For an easy and ready to go installation you could take a look at WAMP ( http://www.e-novative.info/software/wamp/wamp_download.php ) which will install and configure Apache, MySQL and PHP on a Windows server. This worked out of the box for me and PixelPost ran immediately with no tweaking or changes required.

riken
08-09-2005, 01:30 AM
This worked out of the box for me and PixelPost ran immediately with no tweaking or changes required.
I'm suprised by this because acording to the WAMP site it installs PHP5. Could you please check your General Info and see if you are running PHP4 or PHP5. Thanks.

AndyK
08-09-2005, 06:35 AM
Yes, you're correct Riken. I checked and the current version of WAMP installs PHP 5.0.4 so fcollman, ignore my advice and downgrade to PHP 4.xx as Riken says. It is quite a long time since I installed this on my server and I'm definately running PHP 4.xx

I would still suggest Apache 1.xx instead of 2.xx on a Windows production server though.

fcollman
08-09-2005, 06:47 PM
well.. until i discover something else that's broken i'm just going to keep using my edited version that seems to work with PHP 5.

could you elaborate on the reasons for downgrading apache?

AndyK
08-10-2005, 03:37 AM
Re PHP and Apache2 under Windows, the following is from the PHP web site (http://docs.php.net/en/install.windows.apache2.html):

We do not recommend using a threaded MPM in production with Apache2. Use the prefork MPM instead, or use Apache1. For information on why, read the related FAQ entry on using Apache2 with a threaded MPM