Operating System - HP-UX
1833857 Members
3715 Online
110063 Solutions
New Discussion

Apache works. PHP not. (PHP modul problem)

 
SOLVED
Go to solution
Knud
Occasional Advisor

Apache works. PHP not. (PHP modul problem)

Hello,
I've installed the Web Server package v.2.0.55.00 (with PHP4 module support) via swinstall. After the installation I started apache and it worked.
Now I want to enable PHP support on the webserver. I followed the assignments on the FAQ site, but nothing changed. The PHP scripts I want to execute will be proffered for download.

What can I do?

Thank you for your help.
12 REPLIES 12
Peter Godron
Honored Contributor

Re: Apache works. PHP not. (PHP modul problem)

Knud,
have you set the MIME type?
Arunvijai_4
Honored Contributor

Re: Apache works. PHP not. (PHP modul problem)

What error messages you are getting ? Can you be more specific ? Check apache log file to find out more on what went wrong.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Knud
Occasional Advisor

Re: Apache works. PHP not. (PHP modul problem)

Hello,

The MIME types are defined with the following line in /opt/hpws/apache/conf/httpd.conf:

AddType application/x-httpd-php .php

I didn't change this line.


The PHP module is added with this line:

LoadModule php4_module modules/libphp4.so

This line was a comment.


I changed also the following comment in /opt/hpws/apache/bin/apachectl into active:

export LD_PRELOAD="$LD_PRELOAD:$ORACLE_HOME/JRE/lib/PA_RISC/native_threads/libja
va.sl"

Thats the description in this FAQ entry.
http://www.hp.com/products1/unix/webservers/apache/faqs/index.html#php3


The only "error" I get is, that I can download the *.php-files like *.zip-files (or something else) from the webserver. The code will not execute.
In the apache error log (/opt/hpws/apache/logs/error_log) are no errors.

Thanks
Peter Godron
Honored Contributor

Re: Apache works. PHP not. (PHP modul problem)

Knud,
I assume you have ScriptAlias and Action clauses for the PHP in httpd.conf ?
Action application/x-httpd-php ...
Knud
Occasional Advisor

Re: Apache works. PHP not. (PHP modul problem)

Hi Peter,
No I haven't. What do I have to add?
Peter Godron
Honored Contributor

Re: Apache works. PHP not. (PHP modul problem)

Knud,
just before we start down this road. After doing your changes did you restart the apache server?

Also have a look at:
http://php.mirrors.ilisys.com.au/manual/en/install.unix.php
Knud
Occasional Advisor

Re: Apache works. PHP not. (PHP modul problem)

Hi Peter,

Yes I did.

What's the difference of PHP as a static and a shared module?
Knud
Occasional Advisor

Re: Apache works. PHP not. (PHP modul problem)

Hi,

Don't ask me why... but now it works...

I removed the package and installed it again. After a reboot I started apache and it worked.

Thanks for your help :-)
Peter Godron
Honored Contributor
Solution

Re: Apache works. PHP not. (PHP modul problem)

Knud,
if you find out what the underlying problem was, please let us know.
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 ;-)
Knud
Occasional Advisor

Re: Apache works. PHP not. (PHP modul problem)

Sure, I will ;-)

Another question: How can I connect to an mysql database? Is the mysql support enabled?
Arunvijai_4
Honored Contributor

Re: Apache works. PHP not. (PHP modul problem)

Hello, You need to recompile PHP to enable MySQL support. Also, you can find FAQ here,
http://www.hp.com/products1/unix/webservers/apache/faqs/index.html#php

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Knud
Occasional Advisor

Re: Apache works. PHP not. (PHP modul problem)

This means that I have to start the configure script with other options (--with-mysql)?
Because I read that mysql is built in PHP.