View previous topic :: View next topic |
Author |
Message |
Yami King -
Joined: 08 Sep 2005 Posts: 120
|
Posted: Tue Jul 04, 2006 2:12 pm Post subject: Different PHP for every user |
|
|
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 |
|
|
pkSML -
Joined: 29 May 2006 Posts: 952 Location: Michigan, USA
|
Posted: Tue Jul 04, 2006 3:02 pm Post subject: |
|
|
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 |
|
|
Yami King -
Joined: 08 Sep 2005 Posts: 120
|
Posted: Tue Jul 04, 2006 4:14 pm Post subject: |
|
|
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 |
|
|
Tim1681 -
Joined: 17 Jan 2005 Posts: 160 Location: Bristol, CT, USA
|
Posted: Tue Jul 04, 2006 4:26 pm Post subject: |
|
|
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 |
|
|
pkSML -
Joined: 29 May 2006 Posts: 952 Location: Michigan, USA
|
Posted: Tue Jul 04, 2006 4:41 pm Post subject: Regarding the location of php.ini |
|
|
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 |
|
|
Yami King -
Joined: 08 Sep 2005 Posts: 120
|
Posted: Tue Jul 04, 2006 5:25 pm Post subject: |
|
|
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 |
|
|
pkSML -
Joined: 29 May 2006 Posts: 952 Location: Michigan, USA
|
Posted: Tue Jul 04, 2006 6:01 pm Post subject: |
|
|
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 |
|
|
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Tue Jul 04, 2006 6:12 pm Post subject: |
|
|
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 |
|
|
Yami King -
Joined: 08 Sep 2005 Posts: 120
|
Posted: Tue Jul 04, 2006 6:56 pm Post subject: |
|
|
Alright all thanks for your replies :)
Just putting the php.ini in the php home directory :D. |
|
Back to top |
|
|
|