OpenKB::Server Technical Papers

PHP

PHP/IIS7 – IIS to return a 502 Bad Gateway

by admin on Jan.16, 2010, under PHP, Windows

php-cgi.exe does work on IIS7. You need to modify PHP.INI to have the line:

cgi.force_redirect = 0

If you do not do this modification, PHP-CGI.EXE outputs a security warning response without proper response headers, which causes IIS to return a 502 Bad Gateway. Strangely, running PHP-CGI.EXE from the commandline does not generate this error – I guess using NPH CGI is the only way to debug PHP, because running it from the commandline is not 100% indicative of web-server Runtime behavior.

Tested using VC9 x86 Thread Safe PHP 5.3

Comments Off more...

PHP compression using gzip

by admin on Jan.10, 2010, under PHP

The best way to compress PHP files is to use

auto_prepend_file

Add the filling code to a file called gzip.php

<?php

    if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))

        ob_start("ob_gzhandler");

    else

        ob_start();

?>

Then update your php.ini files as follows

auto_prepend_file= /path/to/gzip.php

you can also use a htaccess file if your server permits

php_value auto_prepend_file gzip.php

Testing the compression

More detailed information on compressing files

Comments Off more...

PHP – File too large to upload

by admin on Oct.02, 2009, under PHP

Your file size upload is controlled by two variables in php.ini

upload_max_file_size and post_max_file_size

Comments Off more...

missing the mysql which is required for wordpress

by admin on Sep.11, 2009, under PHP

php installation appears to be missing the mysql which is required for wordpress

======
open the php.ini file.
if you do a search for extension=php_mysql.dll and un comment it ie delete the ; at the beginning of the line
then search further up in the ini file for extension_dir=”./” and replace ./ with c:\php\ext (assuming your php is in c:\php) so it will look like: extension_dir=”c:\php\ext”. This tells php that the dllfor the php_mysql.dll is located in c:\php\ext.
save your php.ini
Also copy libmysql.dll from c:\php c:\windows\system32 and then restart IIS

Comments Off more...

PHP has encountered an Access Violation

by admin on Sep.11, 2009, under PHP

There seems to be a bug when using PHP version 5.2.10 on windows 2003. Using the isapi module We have encountered the following error
“PHP has encountered an Access Violation”

After downgrading to 5.2.6 the error has cleared.

Comments Off more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!