Different PHP for every user

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Yami King
-


Joined: 08 Sep 2005
Posts: 120

PostPosted: Tue Jul 04, 2006 2:12 pm    Post subject: Different PHP for every user Reply with quote

Hi,

I had a question regarding PHP and it's php.ini.

Is it possible to run multiple PHP's on Abyss, so every user has one of it's own. Or even something that would be better: That everyone has it's own php.ini?

Is this possible, if yes, how?
Back to top View user's profile Send private message Send e-mail
pkSML
-


Joined: 29 May 2006
Posts: 913
Location: Michigan, USA

PostPosted: Tue Jul 04, 2006 3:02 pm    Post subject: Reply with quote

Yes, this is possible, but it would make management of your scripts very frustrating.

First of all, how many users are you planning on having a unique PHP interpreter?
Also, if you could divulge why you want each user to have a separate interpreter, this would help.

Install Interpreters

You'll need to install PHP to as many locations as you need users. For example, for user 1, install a copy of PHP in c:\php1\. For user 2, install PHP to c:\php2... This will allow you to control the php.ini file for each user.

Set up Abyss

In Abyss, you must set up as many PHP interpreters as you need. If you have Abyss X1 or X2 (with only one host), you'll find the page at http://127.0.0.1:9999/hosts/host@0/edit/scripting on the server computer.

To keep the scripts unique to a user, give each interpreter a different "associated extension".
For user 1, the interpreter is located in c:\php1\ and its associated extension would be "php1".
For user 2, the interpreter is located in c:\php2\ and its associated extension would be "php2"...

Create Your Files

This is a headache, though, because, if you have helloworld.php, you'd have to make a bunch of copies of it, renaming each to helloworld.php1, helloworld.php2, ...

Does this solution help you?
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
Yami King
-


Joined: 08 Sep 2005
Posts: 120

PostPosted: Tue Jul 04, 2006 4:14 pm    Post subject: Reply with quote

This solution does help me quite a bit actually, but not completely:
I want a different php.ini for every user, the php.ini is standard found as windows/php.ini. How do I change this in, for example, c:/user1/php/php.ini and is it possible to rename this file to for example c:/user1/php-web.config?

I want a different PHP & php.ini just for myself and so other computer users can use a different one, quite hard to explain the complete situation but what I'm really trying to establish is an intranet with the possibilities mentioned above :).
Back to top View user's profile Send private message Send e-mail
Tim1681
-


Joined: 17 Jan 2005
Posts: 160
Location: Bristol, CT, USA

PostPosted: Tue Jul 04, 2006 4:26 pm    Post subject: Reply with quote

Are the .php files you're accessing going to be the same files that the other users access? Or are you going to be accessing you're own private php files for administrative purposes while everyone else uses other 'public' pages on the server?
_________________
mysql> SELECT * FROM users WHERE clue > 0;
0 rows returned.

Back to top View user's profile Send private message AIM Address
pkSML
-


Joined: 29 May 2006
Posts: 913
Location: Michigan, USA

PostPosted: Tue Jul 04, 2006 4:41 pm    Post subject: Regarding the location of php.ini Reply with quote

Quote:
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; This file controls many aspects of PHP's behavior. In order for PHP to
; read it, it must be named 'php.ini'
. PHP looks for it in the current
; working directory
, in the path designated by the environment variable
; PHPRC, and in the path that was defined in compile time (in that order).
; Under Windows, the compile-time path is the Windows directory. The
; path in which the php.ini file is looked for can be overridden using
; the -c argument in command line mode.

Source: php.ini

Sorry, php.ini MUST be named php.ini and nothing else.
-------------------------------
Regarding the directory of php.ini, you can move your current php.ini out of the Windows directory to the directory where PHP is installed without any repercussions.

For user 2, you can have php.ini in his PHP installation directory.

My php.ini is in e:\php because that's where I have PHP installed at.
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
Yami King
-


Joined: 08 Sep 2005
Posts: 120

PostPosted: Tue Jul 04, 2006 5:25 pm    Post subject: Reply with quote

First of all thanks for your quick replies :D.


I think I get it :).

The only thing I just need to know is how to use the -c argument to override my PHPRC variable?

So I can story it in for example c:\user1\webdata\php.ini
Back to top View user's profile Send private message Send e-mail
pkSML
-


Joined: 29 May 2006
Posts: 913
Location: Michigan, USA

PostPosted: Tue Jul 04, 2006 6:01 pm    Post subject: Reply with quote

Just put php.ini in the folder where PHP is installed.

(Your directories may differ somewhat, but here's my example)
For user 1, put php.ini in c:/user1/php/php.ini
For user 2, put php.ini in c:/user2/php/php.ini

When you access a helloworld.php1, PHP will use c:/user1/php/php.ini.
When you access a helloworld.php2, PHP will use c:/user2/php/php.ini.

When the php.ini file says this, "PHP looks for it in the current working directory", it means it will look for php.ini in the directory where php-cgi.exe is being executed for your script.
-----------------------
You can't use the override option because you're not using PHP in command-line mode. (That's the DOS prompt they're talking about. You're running it as CGI.)
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Tue Jul 04, 2006 6:12 pm    Post subject: Reply with quote

The file doesn't /have/ to be called php.ini if you use the -c paramater.
If you provide a directory with -c it will look for php.ini in that directory, otherwise it will use the exact filename you give it.

Also, technically you can provide paramaters when running PHP as a CGI, although I have no idea whether you can configure them in abyss.
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
Yami King
-


Joined: 08 Sep 2005
Posts: 120

PostPosted: Tue Jul 04, 2006 6:56 pm    Post subject: Reply with quote

Alright all thanks for your replies :)

Just putting the php.ini in the php home directory :D.
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group