Page 1 of 1

Help setting up php 5

Posted: Sat Mar 25, 2006 11:08 am
by netslick
Trying to setup PHP5 on apache 2.05

Had this all working before but reinstalled my OS and now can't get it working right.

It works to a point but doesn't show errors and a few other things don't seem to work, this happened before and i fixed it though can't remember exactly what i did, i seem to remember thinking that apache wasn't linking to the php.ini properly or something.

Using windows 98.

In apache httpd.conf i have added.
ServerRoot "C:/server/Apache2"
PHPIniDir "C:/windows" <-- does this need to be in any particular place in httpd.conf

loadmodule php5_module C:/php/php5apache2.dll

DocumentRoot "C:/myroot"

<Directory "C:/myroot">

ScriptAlias /php/ "c:/php/"

AddType application/x-httpd-php .php .html

and have put php.ini in c:\windows and added
extension_dir = "C:/php/ext"
SMTP = smtp.tiscali.co.uk

and have unchecked extensions,

extension=php_mbstring.dll
extension=php_gettext.dll
extension=php_mysql.dll
have also put
php5ts.dll in c:\windows\system
libmysql.dll in both c:\windows and c:\windows\system not sure which one
php_mysql.dll in both c:\windows and c:\windows\system not sure which one

now i'm 99% sure thats exactly what i did first time i set this up and it all worked.

php does work for most things but as i said no errors are displayed if there is a misake in the php it just gives a blank page, or $HTTP_GET_VARS doesnt seem to work, if i did,

Code: Select all

<?php

$s = $HTTP_GET_VARS['s'];
echo $s;

?>
then http://localhost/phptest.php?s=test

i just get a blank page whereas

Code: Select all

<?php


echo "test";

?>
works fine.

Totally stuck!

Posted: Sat Mar 25, 2006 4:31 pm
by feyd
check that your php.ini has register_long_arrays on if you want to use $HTTP_GET_VARS .. should really be using $_GET though.

As for placing dll's in the Windows directory, they shouldn't need to be put there as long as they are in the same directory as the apache SAPI dll.

Posted: Sat Mar 25, 2006 4:59 pm
by netslick
good one, i had the long array off which is weird as i didnt have to set that first time i set this up so http_get_vars works now.

How about the errors ?

Posted: Sat Mar 25, 2006 5:03 pm
by feyd
set error_reporting to E_ALL or E_ALL | E_STRICT
set display_errors to On