Username : Date : Action : Comments [ close all ] |
|
|
|
javiermarcon : 19/05/02 12:56 AM : Incident created |
- Hola,
I'm triying to run php scripts (with permissions 775) but they don't work. I installed apache and php, descomented the lines of php in commonhttpd.conf and started the htppd daemon.
# And for PHP 4.x, use:
#
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
This are the scripts I try to run:
************************************
echo "Hello World";
?>
************************************
y
************************************
phpinfo();
?>
************************************
This scripts are very simple. Why they don't work?
Javier.
|
|
|
|
delyan : 19/05/02 03:02 PM : Reply received |
- if you typed them exactly as here they wont work...
you have to type as this:
<?
echo "Hello World";
?>
Did you see the opening "<?" ?
---
If this answer resolves your problem, please remember to close this question.
|
|
|
|
javiermarcon : 20/05/02 12:28 AM : More info provided |
- Thanks, but I typed like that but with php after the "?"
Here was the original file:
"<HTML>
<?php
phpinfo();
?>
</HTML>"
|
|
|
|
javiermarcon : 20/05/02 01:08 AM : More info provided |
- Someone told me that I have to load the php module but I tried with modprobe php, modprobe apache_php, etc and I can't find that module. How do I load it? thanks.
|
|
|
|
pirnaver : 20/05/02 10:15 AM : Reply received |
- urpmi mod_php
|
|
|
|
javiermarcon : 20/05/02 05:06 PM : More info provided |
- Thanks, I have installed the module (with urpmi) but I don't know how to load it (I tried with modprobe but it didn't worked)
|
|
|
|
delyan : 20/05/02 06:47 PM : Reply received |
- You don't have to load it - Apache loads it! Just restart Apache.
|
|
|
|
pirnaver : 20/05/02 06:55 PM : Reply received |
- You have installed php and php-common?
|
|
|
|
pirnaver : 20/05/02 06:56 PM : Reply received |
- This is how you restart Apache:
service httpd restart
|
|
|
|
javiermarcon : 20/05/02 09:41 PM : More info provided |
- Thanks, I restarted the service but it still doesn't work.
I restarted first with apachectl stop and apachectl start and since php didn't worked I restarted it with service httpd restart.
|
|
|
|
javiermarcon : 20/05/02 09:49 PM : More info provided |
- Thanks, I have installed this packages:
apache-1.3.23-4mdk
Apache-ASP-2.31-1mdk
apache-common-1.3.23-4mdk
apache-conf-1.3.23-4mdk
apache-manual-1.3.23-4mdk
apache-mod_perl-1.3.23_1.26-5mdk
apache-modules-1.3.23-4mdk
mod_frontpage-1.6.1-3mdk
mod_perl-common-1.3.23_1.26-5mdk
mod_php-4.1.2-1mdk
php-4.1.2-1mdk
php-common-4.1.2-1mdk
php-mysql-4.1.2-2mdk
|
|
|
|
pirnaver : 20/05/02 10:32 PM : Reply received |
- Check access and error log:
tail /var/log/httpd/access_log
tail /var/log/httpd/error_log
Can you run php from command line (you may need to install php-readline)?
php
<? echo "This works!" ?>
CTRL D for EOF (end of file)
|
|
|
|
javiermarcon : 21/05/02 01:22 AM : More info provided |
- Thanks, from command line php works perfectly, from the web browser (galeon) it doesn't work. I didn't found anything unusual in those logs you mentioned.
/home/javier/$ php
<? echo "This works!" ?>
X-Powered-By: PHP/4.1.2
Content-type: text/html
This works!
/home/javier/$ tail /var/log/httpd/error_log
[Sun May 19 02:14:54 2002] [notice] caught SIGTERM, shutting down
[Mon May 20 15:39:57 2002] [notice] Apache-AdvancedExtranetServer/1.3.23 (Mandrake Linux/4mdk) PHP/4.1.2 FrontPage/5.0.2.2623 configured -- resuming normal operations
[Mon May 20 15:39:57 2002] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Mon May 20 15:47:10 2002] [notice] caught SIGTERM, shutting down
[Mon May 20 15:47:18 2002] [notice] Apache-AdvancedExtranetServer/1.3.23 (Mandrake Linux/4mdk) PHP/4.1.2 FrontPage/5.0.2.2623 configured -- resuming normal operations
[Mon May 20 15:47:18 2002] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Mon May 20 16:37:37 2002] [notice] caught SIGTERM, shutting down
[Mon May 20 16:37:39 2002] [notice] Apache-AdvancedExtranetServer/1.3.23 (Mandrake Linux/4mdk) PHP/4.1.2 FrontPage/5.0.2.2623 configured -- resuming normal operations
[Mon May 20 16:37:39 2002] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Mon May 20 16:45:50 2002] [notice] caught SIGTERM, shutting down
/home/javier/$ tail /var/log/httpd/access_log
127.0.0.1 - - [18/May/2002:13:27:47 -0300] "GET /icons/logo.gif HTTP/1.1" 200 13720 "http://127.0.0.1/" "Mozilla/5.0 Galeon/1.0.3 (X11; Linux i686; U;) Gecko/0"
127.0.0.1 - - [18/May/2002:13:28:03 -0300] "GET /manual/index.html HTTP/1.1" 200 9467 "http://127.0.0.1/" "Mozilla/5.0 Galeon/1.0.3 (X11; Linux i686; U;) Gecko/0"
127.0.0.1 - - [18/May/2002:13:28:03 -0300] "GET /manual/images/apache_header.gif HTTP/1.1" 200 4084 "http://127.0.0.1/manual/index.html" "Mozilla/5.0 Galeon/1.0.3 (X11; Linux i686; U;) Gecko/0"
127.0.0.1 - - [18/May/2002:13:28:03 -0300] "GET /manual/images/pixel.gif HTTP/1.1" 200 61 "http://127.0.0.1/manual/index.html" "Mozilla/5.0 Galeon/1.0.3 (X11; Linux i686; U;) Gecko/0"
127.0.0.1 - - [18/May/2002:13:28:03 -0300] "GET /manual/images/index.gif HTTP/1.1" 200 1540 "http://127.0.0.1/manual/index.html" "Mozilla/5.0 Galeon/1.0.3 (X11; Linux i686; U;) Gecko/0"
127.0.0.1 - - [18/May/2002:13:28:21 -0300] "GET /manual/misc/tutorials.html HTTP/1.1" 200 7478 "http://127.0.0.1/manual/index.html" "Mozilla/5.0 Galeon/1.0.3 (X11; Linux i686; U;) Gecko/0"
127.0.0.1 - - [18/May/2002:13:28:21 -0300] "GET /manual/images/sub.gif HTTP/1.1" 200 6083 "http://127.0.0.1/manual/misc/tutorials.html" "Mozilla/5.0 Galeon/1.0.3 (X11; Linux i686; U;) Gecko/0"
127.0.0.1 - - [18/May/2002:13:28:21 -0300] "GET /manual/images/home.gif HTTP/1.1" 200 1465 "http://127.0.0.1/manual/misc/tutorials.html" "Mozilla/5.0 Galeon/1.0.3 (X11; Linux i686; U;) Gecko/0"
127.0.0.1 - - [18/May/2002:13:29:15 -0300] "GET /manual/server-wide.html HTTP/1.1" 200 11504 "http://127.0.0.1/manual/index.html" "Mozilla/5.0 Galeon/1.0.3 (X11; Linux i686; U;) Gecko/0"
127.0.0.1 - - [18/May/2002:14:59:33 -0300] "GET /server-status HTTP/1.0" 200 1581 "-" "Lynx/2.8.5dev.3 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6c"
/home/javier/$
|
|
|
|
Linegod_7611 : 21/05/02 07:10 AM : Reply received |
- Maybe it's just me, but I don't see where in your logs you have actually attempted to
view the file you created.
For a complete test of php, create a file called 'phptest.php' in the '/var/www/html'
directory with the following line:
<?php phpinfo(); ?>
Then open a browser and go to http://127.0.0.1/phptest.php
-----
Note: If this answer resolves your problem, please remember to close this question.
|
|
|
|
javiermarcon : 22/05/02 03:12 AM : Incident closed |
-
|
|
|