![]() |
Stop PHP executing on a (or multiple) sub-domain(s)
Server: Fedora 7 i686 virtuozzo
cPanel 11.24.5-R38506 WHM 11.24.2 - X 3.9 I'm trying to stop PHP from parsing (executing) on sub domains so that I can offer my VIP members a free sub-domain for their portfolio's (I run a GFX-related forum). Is this possible? I don't want it globally disabled for obvious reasons - just for specified sub-domains. Thanks in advance. P.S: It's my own VPS. |
What you mean by "PHP executing"?
vBulletin don't allow PHP code to be executed in the frontend. The [PHP] bbcode is there just for code highlighting. |
This isn't forum-related it's server-related. I posted it here because it's "Forum and Server Management" and this comes under server management.
I want to stop PHP from parsing or executing on sub-forums on my server - not my forum. I know I can globally stop PHP - but I just want to stop it on certain sub-forums. I am aware of the BBCodes ;) Woops.. title said sub-forums. Dammit. I've done that so many times on Google searches ;(. Sorry guys. |
Quote:
Are you using a control panel or manual editing apache? |
I have a VIP feature which is the ability to have a sub-domain set up for their own personal use - as I explained in the first post.
Of course, I don't want that to be abused in any way so I would like to disable PHP on that sub-domain so that they cannot run PHP scripts on their sub-domain. I am using cPanel and WHM - that is all I am using to run my server. I am hoping there's a configuration option. |
You try this in a php.ini in their public folder?
engine = Off Then chown to root & chmod the php.ini to 000 so they cant see or access it. |
I'll try it.
I'm not familiar with chowning, got any idea what command i'd use? Also, would this be in effect only for that sub-forum or throughout everything? EDIT: I created a file named "php.ini" and put in it "engine = Off" and it hasn't worked. |
chown -h
chown root:root php.ini It should only be in that users sub-domain folder xxxx.xxxxx.xxx/username When apache/php was compiled, was rights given to allow php.ini overwirte by users? |
The sub-domain is:
../public_html/{sub-domain} which is where I placed the php.ini. I'm not sure if the rights were given - the installation of everything was there before I bought the server. Any way I can check? |
try a simple php flag like memory_limit and view a phpinfo file from that location and see if it raises the limit, you should have the two columns in phpinfo and the memory limit for the local side should rise, if not you will need to recompile apache/php.
|
I put memory_limit = 50M into the php.ini and it didn't affect the phpinfo file.
I suppose i'll have to recompile? |
Quote:
|
Bob, there is NO need to restart, if local override is allowed, it's on the fly.
|
Quote:
|
Yea, you wouldn't want to restart apache 300 times a day because ppl keep changing variables.
|
Depending on how you use PHP - if it's the Apache module a simple:
Quote:
Little bit :confused: first allowing this handler to be executed - if it's CGI - just to run PHP in order the PHP interpreter gets it isn't allowed to do anything - so better remove it completely that there're no CGI / FastCGI calls made anyways. |
Where do I put that Angel?
In php.ini or in htaccess? :confused: |
Webserver Configuration if you're using Apache. For Nginx / Lighty or other server just look how PHP is called - usually via FastCGI then - and remove the handler / caller on your virtual hosts where you don't want to have them.
|
This is usually located in /etc/apache2/httpd.conf
I'm not sure for cPanel, I do not use it for years. Using Kloxo (formerly LxAdmin) and Virtualmin. However, if you have root access to cPanel, all config files are editable from within WHM. |
Quote:
|
Quote:
|
place it in the sub-domain container <virtualhost> subdomain </virtualhost>
|
Quote:
Global HTTP Conf: Quote:
Quote:
Just look how you can set FastCGI with an Suexec Wrapper. If you use the Module: Quote:
Or you do it vise versa and disable PHP globally by php.ini then enabling it only for the Vhosts you will need it. :) |
Quote:
|
Quote:
|
I didn't state they wasn't useful, i only stated that they won't work on a cpanel server, which he is using.
|
All times are GMT. The time now is 08:29 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|