OS2 World Community Forum
OS/2, eCS & ArcaOS - Technical => Web applications => Topic started by: Greg Pringle on October 03, 2019, 04:50:21 pm
-
Using Apache 2.2.34 and PHP 5.4.45 is not working as expected.
When php is run by hand it will return "Hello World" from:
set BEGINLIBPATH=D:\php5;D:\php5\modules
php -r "echo 'Hello World';"
When using a web page no results can be obtained.
<?php echo 'Hello World' ?>
Other lines have been tried with no results.
There is a C:\mptn\etc\php.ini
and httpd.conf has:
LoadModule php5_module d:/php5/apache2/modphp5.dll
Any thoughts?
-
No SET LIBPATHSTRICT=T?
If local, is the software in use to view the webpage also using the same LIBPATH setting(s)?
-
Perhaps
AddType application/x-httpd-php .php
in httpd.conf (section <IfModule mime_module>).
Also
DirectoryIndex index.html index.php
always in httpd.conf (section <IfModule dir_module>)
-
Both of the suggestions have just been tried but no luck yet.
I also removed the php.ini and the command line still worked but the web page did not.
-
Try in httpd.conf
LoadModule php5_module modules/modphp5.dll
and copy modphp5.dll in the apache/modules directory.
My startup.cmd for apache:
@echo off
rem adjust as necessary
set HOSTNAME=localhost
set beginlibpath=c:\apps\apache2\bin;c:\apps\apache2\modules;c:\apps\php5;c:\apps\php5\modules;c:\usr\lib
set LIBCX_TRACE=+mmap
bin\httpd -d . 2>&1
Furthermore
ErrorLog "logs/error_log"
LogLevel debug
in httpd.conf and post your log...
(Attached my httpd.conf and php.ini)
-
A bit more is needed in httpd.conf than just loading the module.
Most of https://www.thesitewizard.com/php/install-php-5-apache-windows.shtml is relevant -in particular the references to 'AddType application/x-httpd-php .php'
Cheers,
Paul
-
To all,
PHP5 is now running normally in Apache/2.2.34 (OS/2) PHP/5.4.45
The php.ini is in directory d:\php5
httpd.conf has:
LoadModule php5_module "d:/php5/apache2/modphp5.dll"
PHPIniDir "/php5"
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
<IfModule mime_module>
...
AddType application/x-httpd-php .php
...
</IfModule>
DocumentRoot "/web/corvedia"
then a file was created:
D:\web\corvedia\index.php
<HTML>
<BODY>
This is a test
<p>
<?php echo 'Hello World' ?>
<p>
<?php
phpinfo();
?>
</BODY>
</HTML>
and the PHP information was returned.
Thanks to all.