Current time: 11-27-2024, 07:17 PM Hello There, Guest! (LoginRegister)


Post Reply 
Users: How to edit/access php.ini via FTP
Author Message
edeis Offline
Junior Member
*

Posts: 34
Joined: May 2010
Reputation: 0
Post: #1
Users: How to edit/access php.ini via FTP
Just wondering is it possible for a user to be able to edit their own php.ini file?

/var/www/fcgi/domainname/php5/php.ini

Or is that something that only the system admin can edit?
06-16-2010 09:38 AM
Find all posts by this user Quote this message in a reply
gOOvER Offline
Banned

Posts: 3,561
Joined: Jul 2007
Post: #2
RE: Users: How to edit/access php.ini via FTP
It's Not possible.
06-16-2010 10:06 AM
Visit this user's website Find all posts by this user Quote this message in a reply
edeis Offline
Junior Member
*

Posts: 34
Joined: May 2010
Reputation: 0
Post: #3
RE: Users: How to edit/access php.ini via FTP
How would a user change a php_flag or php_value in ispCP?

Normally, it would be done in .htaccess as:
php_flag register_globals Off

Since we are using fcgi for php, the changes have to be made in the php.ini, which is here:
/var/www/fcgi/domainname/php5/php.ini

It is not possible for the user to edit this file.

I have read that the way to do this is for the user to create their own php.ini file, and set the following in their .htaccess:
SetEnv PHPRC /location/todir/containing/phpinifile

I haven't been able to get this to work. I suspect that the httpd.conf is not allowing the proper override.

I have tried doing so here, with no success:
Code:
<Directory /var/www/virtual/domainname/htdocs>
            AllowOverride All
            FCGIWrapper /var/www/fcgi/domainname/php5-fcgi-starter .php
            Options +ExecCGI
        </Directory>

How can I enable the override?
Here's an idea. Can we set the shell script to check for a custom php.ini file?

/var/www/fcgi/artipedia.org/php5-fcgi-starter
Code:
customphp="/var/www/virtual/domain/php.ini"
if [ -f  $customphp ]
then
   PHPRC="/var/www/virtual/domain/"
else
PHPRC="/var/www/fcgi/domain/php5/"
fi

This works, except apache has to be restarted after the user uploads the php.ini file. Is there a way to make this happen dynamically, without having to restart apache?
(This post was last modified: 06-16-2010 11:47 AM by edeis.)
06-16-2010 11:23 AM
Find all posts by this user Quote this message in a reply
gOOvER Offline
Banned

Posts: 3,561
Joined: Jul 2007
Post: #4
RE: Users: How to edit/access php.ini via FTP
You Know, that your Users can Set now their own open_basedir and their own disabled_functions. Wink
(This post was last modified: 06-16-2010 04:09 PM by gOOvER.)
06-16-2010 04:02 PM
Visit this user's website Find all posts by this user Quote this message in a reply
edeis Offline
Junior Member
*

Posts: 34
Joined: May 2010
Reputation: 0
Post: #5
RE: Users: How to edit/access php.ini via FTP
I didn't know that. How can the users set these functions themselves? I can't find documentation in the forum.
06-16-2010 04:08 PM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #6
RE: Users: How to edit/access php.ini via FTP
Hi edeis

if the customers can create/edit their php.ini then they are able to also change theese values. They can configure "their" php to use all the RAM, to have no restrictions about folders (so only the file permissions can protect other customers on the same server).

That's why it's better to keep customers away from editing their php.ini.

Best way would be: offer the customers a GUI formular where they can choose some values - but you always have the control that no security related variable is changed.


btw: you don't need to restart apache - you only need to kill the php processes which handle your domain...

/J
06-16-2010 04:24 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)