Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm new installing/configuring apache2 and php. Here's what I've done thus far, along with my current server set up. I'm very familiar with Solaris/Sun OS.

Solaris 10, PHP version is 5.3.26, Apache version is 2.2.22 and MySQL version is 5.0.67. I've been able to install/configure Apache and MySQL; website works as I would like; created db and started to write SQL. These work fine.

I installed PHP, and it works only via command line. That is, to execute:

hello.php

<?php echo "Hello World\n" ?>

I use:

% php hello.php

... and I get the expected return of "Hello World" (minus the quotes).

In the httpd.conf (in /etc/apache2), I added:

DirectoryIndex index.html index.php index.html.var
AddType application/x-httd-php .php
AddHandler php5-script .php .html .htm.  

The line that is causing me consternation is the LoadModule php5_module modules/libphp5.so (I've also seen examples that use libexec vice modules).

If the LoadModule line is not commented out in the httpd.conf file, apache goes into maintenance mode. I have my LD_LIBRARY_PATH pointed to /usr/local/lib:/usr/lib:/usr/local/libexec:/usr/local/php/lib:/usr/sfw/lib:/usr/sfw/lib/mysql.

What needs to be done to get PHP working with browsers?

share|improve this question
    
Are you configuring for user html directory? –  John Siu Jan 18 '13 at 20:04
    
I'm trying to configure for web pages with php content, accessible for anyone. There are specific user directories, each having their own public_html. –  Solaris_Guy Jan 18 '13 at 23:00
add comment

1 Answer 1

How did you install PHP and are you sure the Apache module to run PHP in installed? You should be able to get some more information on why Apache is going into maintenance mode by either checking the log file for the Apache service or by looking in Apache's error log.

share|improve this answer
    
I used packages from SunFreeware.com for php, mysql and apache. According to the /var/svc/log/network-http:apache2.log, there is a syntax error on the LoadModule php5_module libexec/libphp5.so line; "Cannot load /usr/apache2/libexec/lib5php.so into server: ld.so.1: httpd: fatal relocation error: file /usr/local/lib/libxml2.so.2: symbol gzopen64: referenced symbol not found". –  Solaris_Guy Jan 18 '13 at 23:01
    
Have you installed all the dependencies? It could look like you are missing a gzip library. You can check for missing libraries for libxml2 with: ldd /usr/local/lib/libxml2.so.2 –  Jeppe Toustrup Jan 19 '13 at 7:20
    
Sorry for late response. my libxml2.so.2 is in /usr/lib; this path is in my LD_LIBRARY_PATH. It's also in /usr/lib/sparcv9; this path is not in my LD_LIBRARY_PATH –  Solaris_Guy Jan 23 '13 at 15:55
1  
Update: after more research, I added the zlib package to my configuration. This cleared up the gzopen64 reference. Now the /var/svc/log/network-http:apache2.log is indicating that the libphp5.so is garbled (expecting signature 41503230 but saw 41503232). Thanks to all who replied. –  Solaris_Guy Jan 24 '13 at 17:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.