Midgard PHP Extension
Midgard 1.8
As of Midgard 1.8, the midgard-php4 extension can be compiled against PHP4 and PHP5. Once compiled, the extension can be used with Apache1 or Apache2 httpd server.
Note: midgard-php extension can not be compiled against PHP with ZTS ( Zend Thread Safety ) support enabled.
If only one PHP version is installed on your system, then most probably you have phpize and php-config scripts.
Build extension
$ phpize
$ ./configure [--with-php-config=/full/path/to/php-config]
$ make
$ make install
Some distributions like Debian provide PHP4 and PHP5 languages. So it's possible to build and install extensions for both PHP versions:
Build against PHP4
$ phpize4
$ ./configure --with-php-config=/usr/bin/php-config4
$ make
$ make install
Build against PHP5
$ phpize5
$ ./configure --with-php-config=/usr/bin/php-config5
$ make
$ make install
Paths used in above examples may vary and you should change them if PHP is installed with a different prefix (like /opt or /usr/local).
Midgard 1.7
Building midgard-php for Apache 1
The easiest way to install the midgard-php module for Apache 1 is to run the following command in midgard-php source directory:
$ ./mkall
Howewer mkall script may not find apxs binary when it is not in system path. In that case, run the mkall script with the parameter --with-apxs which defines the location of the apxs binary file:
$ ./mkall --with-apxs=/usr/sbin/apxs
Building midgard-php for Apache 2
midgard-php built for Apache 2 requires apr-config, so build this module using the mkall script with parameters:
$ ./mkall --with-apxs --with-apr-config
If either of the binaries are not in system path, define the paths of the binaries:
$ ./mkall --with-apxs=/usr/sbin/apxs --with-apr-config=/usr/bin/apr-config
apxs (Apache 1) and apxs2 (Apache 2) to allow for parallel installation. In this case you need to add the locations to the apxs2 files to the mkall command line, otherwise you will get tons of segfaults. With Debian, running ./mkall --with-apxs=/usr/bin/apxs2 --with-apr-config=/usr/bin/apr-config should suffice.
Important Changes in php.ini
Make sure that the Midgard PHP extension is loaded in the php.ini file; if not add the following line there:
extension=midgard.so
It's also recommended to change these php.ini values (they can be set in the virtual host configuration too):
; Required for uploading attachments
file_uploads = On
; Required by majority of the Midgard PHP applications
magic_quotes_gpc = Off
; Required by MidCOM <= 1.4
short_open_tag = On
; Recommended at least for MidCOM AIS (8M is the minimum requirement)
memory_limit = 8M
; Maximum size of POST data (affects attachment uploads)
post_max_size = 8M
; Maximum size for uploaded files (affects attachment uploads)
upload_max_filesize = 2M
; The following settings are recommended to be set in the virtual host
; configuration instead and are shown here for your convenience only
;
; Required by Spider and Aegir
register_globals = On
