You are not logged in.
Hi everyone.
I have installed apache and php from the repository, but I am unable to get php to work for my websites. Everything seems to be in order. I added that to the apache`s config file:
LoadModule php5_module modules/libphp5.so
And here is the loaded module I started the server:
[~] apachectl -M
...
php5_module (shared)
Syntax OK
Apache web server is up and running, but still, when I open the page in web browser, I got the php code as output. The code is:
<?php
echo "Here we are";
?>
When I run the code using php from terminal, everything is in order. Where the hack can be the problem. It is something very simple and stupid, I am sure, but I cannot find it.
Regards.
Last edited by Gruntz (2008-10-27 15:19:25)
Offline
Hi, I solved the problem. You have to add:
Include conf/extra/php5_module.conf
to the httpd.conf fail in order to get it to work. It is written on the screen when you install php, but at first time, I did not noticed it.
Regards.
Offline
I appear to have a similar problem can anyone advise...
Apr 12 16:47:29 crematoria httpd: PHP Warning: Unknown: open_basedir restriction in effect. File(/media/serverFiles/index.php) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/) in Unknown on line 0
Apr 12 16:47:29 crematoria httpd: PHP Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0
Apr 12 16:47:29 crematoria httpd: PHP Fatal error: Unknown: Failed opening required '/media/serverFiles/index.php' (include_path='.:/usr/share/pear') in Unknown on line 0
Apr 12 16:47:32 crematoria httpd: PHP Warning: Unknown: open_basedir restriction in effect. File(/media/serverFiles/index.php) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/) in Unknown on line 0
Apr 12 16:47:32 crematoria httpd: PHP Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0
Apr 12 16:47:32 crematoria httpd: PHP Fatal error: Unknown: Failed opening required '/media/serverFiles/index.php' (include_path='.:/usr/share/pear') in Unknown on line 0
---EDIT---
As i initially suspected, php.ini can restrict what dirs can be accessed, but i fixed it
Last edited by darthaxul (2009-04-13 01:43:50)
Offline
What is the solution to the open_basedir problem ?
Offline
I appear to have a similar problem can anyone advise...
Apr 12 16:47:29 crematoria httpd: PHP Warning: Unknown: open_basedir restriction in effect. File(/media/serverFiles/index.php) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/) in Unknown on line 0
Apr 12 16:47:29 crematoria httpd: PHP Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0
Apr 12 16:47:29 crematoria httpd: PHP Fatal error: Unknown: Failed opening required '/media/serverFiles/index.php' (include_path='.:/usr/share/pear') in Unknown on line 0
Apr 12 16:47:32 crematoria httpd: PHP Warning: Unknown: open_basedir restriction in effect. File(/media/serverFiles/index.php) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/) in Unknown on line 0
Apr 12 16:47:32 crematoria httpd: PHP Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0
Apr 12 16:47:32 crematoria httpd: PHP Fatal error: Unknown: Failed opening required '/media/serverFiles/index.php' (include_path='.:/usr/share/pear') in Unknown on line 0---EDIT---
As i initially suspected, php.ini can restrict what dirs can be accessed, but i fixed it
1. about open_basedir error, you need to add document root path to php.ini
vim /etc/php/php.ini
open_basedir = Add your document root path in here.
2. about pear issue, I dont know what pear is, but I install it to solve this isse:
pacman -S php-pear
/etc/rc.d/httpd restart
Hope this helps
Offline
hello, faced with the problem at the opening http://10.10.54.209/zabbix , in the log indicates an error error.log
PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0, referer: http://10.10.54.209/
PHP Fatal error: Unknown: Failed opening required '/srv/http/zabbix/index.php' (include_path='.:/usr/share/pear') in Unknown on line 0, referer: http://10.10.54.209/
pacman -Q | egrep zabbix
zabbix-agent 1.8.8-1
zabbix-server 1.8.8-1
ls -ld /srv/http/zabbix/
drwxr-xr-x 10 root root 4096 окт. 26 17:39 /srv/http/zabbix/
Offline
Uncomment extension=bcmath.so in php.ini
Offline
jabalv,
Welcome to Arch Linux. And thank you for the suggestion. Be aware that that this thread is just shy of three years since the last post; I hope they are not still fighting the issue
I'll leave the thread open as I believe your post is relevant. Just be aware of our policy
Thanks
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline