PHP with Apache
I have no problem getting php to work under root, but when I copy the apache Dir to a users home Dir (so I can give them access to thier own web server) php won't work.
What do I need to do to enable php for other users? |
You mean, other users of LAN can't access web page on the server.
Open port 80 on firewall. It is preventing user to access web on the server. |
Are you sure it is php that does not work?
If you put a plain html file in the user's home directory, does that work? |
Why are you copying the apache dir into the user's home dir? Why not just give the user write permissions on the original apache dir?
|
Quote:
Not overtly versed with php yet, is this something I'll need to config within php somewhere? If so what/where? I like setting up apache this way to keep it as isolated from root as possible, also makes experimenting easy. Thank you for your replies :) |
What are ownership and permission on the php files?
What is being logged in access_log and error_log? |
Is the user_dir in /etc/php.ini set to public_html? If you created an apache directory in each users /home directory, you need to change this entry.
|
Quote:
user_dir = to public_html = Nothing, is this wrong? Is there more I should configure? http://localhost/index.php:8080 results in URL not found http://localhost:8080 results with normal plain html files showing up fine. http://localhost --everything works as it should. (root) |
Quote:
user_dir = apache |
Quote:
This is most likely a big part of the problem: I have the included version of apache installed, but I removed the existing apr/apr-util and installed the newest versions so I could config/install apache-2.4.3 that I downloaded. So this gives me an apache2 dir under path= /usr/local/apache2 I then copy this apache2 to my Users home dir and rename it 'apache' path= /home/username/apache At which point I edit its httpd.conf file for that users dir. (ports/access etc...) So...php works in the pre-configured pre-installed apache...but not for my 2.4.3. Php paths are obviously not configured correctly. I would really like to figure this out, once again I appreciate your suggestions.:) (maybe this extra info will clear things up a bit...;) ) |
You changed it incorrectly, it should be the following in php.ini:
Code:
user_dir = "public_html" Quote:
Quote:
|
Quote:
I'm using Centos 6.3, currently trying to implement the info you have offered, thank you :) I'm curious, are you thinking I'm try to use the virtual hosts provided with the auto installed/yum install httpd apache? I don't want to use this version, /var/www/html/ /etc/httpd/conf/httpd.conf I have manually downloaded and installed apache.2.4.3 and it's path is /usr/local/apache2 all config files I should need are in this dir. Of course I then copy the apache2 server to a users home dir and configure it from there. I've been stuck using the other apache server because it's the only one that php will play with. Would you agree or disagree with this approach? Should I scrap this and focus on virtuals? Trying out different configs is relatively painless as I'm using VMs for development. |
List of public*
/usr/share/selinux/devel/include/services/publicfile.if /usr/share/selinux/targeted/publicfile.pp.bz2 /usr/share/man/man8/publicfile_selinux.8.gz /usr/local/apache2/manual/howto/public_html.html.ja.utf8 /usr/local/apache2/manual/howto/public_html.html.ko.euc-kr /usr/local/apache2/manual/howto/public_html.html.fr /usr/local/apache2/manual/howto/public_html.html.en /usr/local/apache2/manual/howto/public_html.html /usr/local/apache2/manual/howto/public_html.html.tr.utf8 /usr/src/httpd-2.4.3/docs/manual/howto/public_html.html.ja.utf8 /usr/src/httpd-2.4.3/docs/manual/howto/public_html.html.ko.euc-kr /usr/src/httpd-2.4.3/docs/manual/howto/public_html.html.fr /usr/src/httpd-2.4.3/docs/manual/howto/public_html.html.en /usr/src/httpd-2.4.3/docs/manual/howto/public_html.html /usr/src/httpd-2.4.3/docs/manual/howto/public_html.html.tr.utf8 /etc/selinux/targeted/modules/active/modules/publicfile.pp /home/vmquik/apache/manual/howto/public_html.html.ja.utf8 /home/vmquik/apache/manual/howto/public_html.html.ko.euc-kr /home/vmquik/apache/manual/howto/public_html.html.fr /home/vmquik/apache/manual/howto/public_html.html.en /home/vmquik/apache/manual/howto/public_html.html /home/vmquik/apache/manual/howto/public_html.html.tr.utf8 /var/spool/postfix/public |
Sorry, the suggestion I posted above is only for virtual hosts. I have Apache configured on a localhost and have access to directories/files in the /home/user/public_html directory. I'm not using CentOS or the version of apache you are. I have a modules.d directory in the /etc/httpd directory and in that directory is a file named 67_mod_userdir.conf which has a Directory entry relating to public_html. You might look for a file with a similar name and try that. It's been so long since I've done this I really don't remember. You could also take a look at the Apache site below:
http://httpd.apache.org/docs/2.2/howto/public_html.html Have you made the change in the php.ini file. If you can access other files in the user directory but not php files, that would seem to be the problem? |
Quote:
Once again, I appreciate your time and suggestions.:) |
All times are GMT -5. The time now is 06:46 AM. |