Re: [Mod-fcgid-users] mod_fcgid, php-fcgi and PHPRC

2008-06-13 Thread Igor R.
Hi All,

Thanks to all who responded regarding my issue. I solved it with the help of
writting the wrapper with the following content: 

#!/bin/bash
USER=`id -un`
export HOME=`/usr/sbin/pw user show $USER | awk -F ":" '{print $9}'`
export PHPRC=$HOME/public_html/php.ini
export PHP_FCGI_CHILDREN=0
exec /usr/local/cpanel/cgi-sys/php5.bin

the code was created for  FreeBSD, that's why it will be requiered to
correct this code in for $HOME varible processing for Linux, for instance in
such a way:

HOME=`/bin/cat /etc/passwd | grep $USER: | awk -F ":" '{print $6}'`

--
Regards,
Igor R.
Technical Support Teamleader
WebHostingBuzz.com
 



-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Mod-fcgid-users mailing list
Mod-fcgid-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users


Re: [Mod-fcgid-users] mod_fcgid, php-fcgi and PHPRC

2008-06-13 Thread Tobias Wiersch
Hi Igor,

Igor R. schrieb:
> But I don't want to make a new wrapper and change PHPRC variable after each
> new user creation. 
>   

I patched suexec to do this (to get rid of the wrapper-script). My
suexec is allowed to only call the php-exe and nothing else.
In addition, I put in PHPRC and PHP_FCGI_MAX_REQUESTS.

To do this, I replaced the function call of clean_env with:
static void clean_env(const char *uname)

In clean_env I added some env-vars:
sprintf(pathbuf, "PHP_FCGI_MAX_REQUESTS=%s", "250");
cleanenv[cidx]=strdup(pathbuf);
cidx++;
sprintf(pathbuf, "PHPRC=/home/%s/config/", uname);
cleanenv[cidx]=strdup(pathbuf);
cidx++;

And I call clean_env with the current user:
target_uname = argv[1];
pw = getpwuid(atoi(target_uname));
actual_uname = strdup(pw->pw_name);
clean_env(actual_uname);

As you can see, the PHPRC for a any user is: /home/xxx/config/
Where xxx is the username.

Hope this helps ...

Greetings ... Tobias


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Mod-fcgid-users mailing list
Mod-fcgid-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users