Click to See Complete Forum and Search --> : only appears the code


eduac
05-16-2003, 02:52 AM
My apache server has been functioning normally with Linux Suse. But mod-php seems does not work, i record a php code of test in /usr/local/httpd/htdocs/ and when i try to execute into the browser, only appears the code but not the result.

Somebody could say to me the steps to finish the installation of php into the apache server?

Comment: I install the mod-php already, but does not work. :(

planetsim
05-16-2003, 03:48 AM
Did you restart the Server

eduac
05-16-2003, 04:05 AM
Yeap


apachectl start

Natty_Dreadlock
05-16-2003, 12:11 PM
which module order do u use... If u have mod_gzip enabled, it might compress the data and when php tries to parse those data, nothin will happen at all. So first check the order your others mods are doin something with your data and change it so that php is the first one that gets to see the data.

eduac
05-16-2003, 12:26 PM
I think that you did not understand very well. I already have installed the php mod4, but that it does not work. :(

Natty_Dreadlock
05-16-2003, 12:35 PM
I guess u have a new apache installation and now u installed php-mod which does not work at all - and one reason might be the one I told u....

eduac
05-16-2003, 12:44 PM
so, what can i do? :confused:

tsinka
05-16-2003, 04:11 PM
Hi,

did you check the httpd.conf and the startup message of apache ?

Make sure that there is a LoadModule ....libphp4.so in one of the configuration files in /etc/httpd (since SuSE splits the configuration up to several files).

At least the following lines must exist in the httpd.conf (or might be included by the apache init script):

LoadModule ....libphp4.so

and

AddType application/x-httpd-php .php .phtml ......

Also check the /var/log/messages for errors and if the php module appears in the startup message of apache.


Which SuSE version do you use ? There are some differences depending on the version :)

eduac
05-16-2003, 04:15 PM
version 8.1

tsinka
05-16-2003, 04:24 PM
Ok,

SuSE 8.1. Did you also install the mod_php4-core package ? That is mandatory.

After that edit /etc/sysconfig/apache and ensure that the following line exists:

HTTPD_SEC_MOD_PHP = yes

Then restart apache

/etc/init.d/apache restart

Hope this helps :)

Thomas

eduac
05-18-2003, 03:48 AM
I only made everything what you asked for....finally he initiated apache together with mod-php perfectly, but still continue the problem: only appears the code in the konqueror browser, not the result of then:
I do everything:

1) put the string LoadModule...libphp4.so into the httpd.conf
2) check the AddType application/x-httpd-php into the httpd.conf
3) Verify the errors into /var/log/messages (no errors about php)
4) The package mod_php4_core completely installed
5) HTTPD_SEC_MOD_PHP = yes checked
6) Run the code into /srv/www/httpd/htdocs/
8) All the packages of mod-php completely installed

I dont know what i can make to this work on. :( :( :(

Please, anyone have a little help about this problem?

tsinka
05-18-2003, 06:51 AM
Hi,

check the error_log:

is there something like

[Tue Dec 10 17:51:51 2002] [notice] Apache/1.3.26 (Linux/SuSE) PHP/4.2.2 configured -- resuming normal operations

The message might look different depending on how much modules were activated but it it mandatory that PHP/4.2.2 or something like that appears. If it doesn't then something went wrong.

My post had an error. Please do the following to make shure that SuSE is able to activate php automatically:

Remove the LoadModule and AddModule lines (LoadModule ...libphp4.so and AddModule mod_php4.c)

Remove all lines containing AddType application/x-httpd-php .php..

Make sure that there are no sections like

<IfModule mod_php4.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
</IfModule>

Make sure that you installed the original mod_php4 modules for that SuSE version.

Ensure that the stuff is done in my last post.

Now comes my fault:

In order to activate that settings you additionally have to execute:

SuSEconfig --module apache

Then restart the apache server.

If then php still doesn't parse the code ... no idea :(

It would then be probably the best to post the parts of your httpd.conf.

tsinka
05-18-2003, 06:53 AM
One more point.

If rpm complained about that you manually edited httpd.conf it might be that there is a file called httpd.conf.rpmnew which contains the new lines. You need to merge them into httpd.conf in that case :)

eduac
05-18-2003, 01:39 PM
I will try, dude...wait for my feedback.... ;)

eduac
05-18-2003, 05:52 PM
View the message when i starting the apache:

This is correct? :confused:

linux:/sbin/conf.d # /etc/init.d/apache restart
Shutting down httpd done
Starting httpd [ PHP4 ][Sun May 18 17:36:05 2003]
[warn] module php4_module is already loaded, skipping [Sun May 18 17:36:05 2003]
[warn] module mod_php4.c is already added, skipping done


The problem persists.

tsinka
05-18-2003, 06:18 PM
Hi,

the LoadModule and AddModule lines exist two times in the httpd.conf. You can remove one of them.

It's not my day, the php module gets included by suse_loadmodule.conf and suse_addmodule.conf if php is enabled :(
if you check /var/log/httpd/error_log what does the apache startup line show ?

What file name has your php script ? Can you post the contents of the script.

I think, I oversaw something ... but what ?

I installed SuSE linux about 50 to 70 times and never had such problems.

eduac
05-18-2003, 06:57 PM
I attach the httpd.conf into this forum, so you can verify if exists any error.
And the messages of /var/log/messages, i search into the file and did not find nothing referring to the apache.

My impression is everything are correctly installed (apache and php mod), but only compilation of the php code does not exist.

Here is my code test:


<?

phpinfo();

?>



:confused: :confused: :confused:

tsinka
05-18-2003, 07:03 PM
Hi,

/var/log/messages doesn't contain apache messages, check /var/log/httpd/error_log :)

tsinka
05-18-2003, 07:19 PM
Interesting,

the DocumentRoot is /var/www/htdocs. Did you try to place your script into /var/www/htdocs ?

Which version(s) of apache are installed (rpm --query --all |grep apache) ?

eduac
05-18-2003, 07:22 PM
Here is the messages of /var/log/httpd/error_log

>>>>


[Sun May 18 19:15:43 2003] [notice] Apache/1.3.26 (Linux/SuSE) PHP/4.2.2 configured -- resuming normal operations
[Sun May 18 19:15:43 2003] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun May 18 19:15:43 2003] [notice] Accept mutex: sysvsem (Default: sysvsem)


Yes, i put the code into /var/www/htdocs....

Apache version: 1.3.26-39

tsinka
05-18-2003, 08:07 PM
Hi,

one idea:

Could it be that short_open_tag is set to Off ?

You might then try:


<?PHP
phpinfo();
?>


Add PHP after <?


Also ensure that
engine = On is set in php.ini

T.

eduac
05-18-2003, 10:45 PM
I try and did not work on. Thanks for all help, but i going to desist, i try to reinstall the apache/php and when i was start, appeared this:


linux:~ # apachectl start
Syntax error on line 1 of /etc/httpd/suse_loadmodule.conf:
Cannot load /usr/lib/apache/libssl.so into server: /usr/lib/apache/libssl.so: cannot open shared object file: No such file or directory
/usr/sbin/apachectl start: httpd could not be started


Forgive me but i will come back to the windows and remove the linux from my computer. :o :o :o

eduac
05-19-2003, 02:34 AM
The problem with to initiate the apache, i resolve … but the problem to only appear the php code into browser persists. I gonna contact the SuSE support. Thanks for all. :rolleyes:

tsinka
05-19-2003, 02:10 PM
Hi,

the last error appeared because the mod_ssl package is missing. Contacting the support would probably be the best. If there's no sensitive data on that server reinstalling SuSE from scratch should solve the problem, too. I think the main problem is that you/we touched configuration files manually we shouldn't touch. The rpm package installer then sometimes doesn't adjust that configuration files but places files like httpd.conf.rpmnew into the directories not touching the "hot" ones. It can be really hard work to get rid of that.

Make shure to install only one apache and php version, e.g. concurrently installing apache 1.3.x and apache 2.x can lead to problems like the ones you described.

I think it is nearly impossible for me to find the problem without being able to login to that machine.

Don't give up too fast. Once you've things up and running you'll see that lamp has some advantages over wamp :)

T.

eduac
05-19-2003, 03:58 PM
Thanks for everything tsinka, and forgive me for my little criticizing about the Linux SuSE, after all i know that this a german version of linux… heheh… :D :D :D (for me, its the best of the all linux variants).
I dont give up, i try to contact the SuSE support. Anyway thank you very much, you was the only one that helped me in this problem. :) :) :)