Koozali.org: home of the SME Server

[How-to] install php5-cgi

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
[How-to] install php5-cgi
« on: June 18, 2007, 01:08:10 PM »
Hi everyone.

You'll find here a how-to for the installation of php5 as a cgi. This way, you can run some webapps which requires php5 without upgrading your system to php5.
I've done this to run vtiger CRM 5.03 on SME and it seems to work now. I haven't tested extensivly this so if you have any feedback, it'll be appreciated.

link to the how-to: http://sme.firewall-services.com/spip.php?article46

Please, consider this how-to as beta, I've just wrote it, so try it first on a test server.
C'est la fin du monde !!! :lol:

it4orce

[How-to] install php5-cgi
« Reply #1 on: June 21, 2007, 12:11:05 PM »
I have used this howto with the 5.0.3 version of vtiger. Everything installs perfectly , except for the fact that i cannot create users. Have you had any experience with this issue ? i have checked the forums at vtiger, and all leads to php versions.

I have followed your instructions to have php 5.1.2 as a cgi. so it shouldn’t be a problem, should it ?

Any links or advice would be greatly appreciated.

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
[How-to] install php5-cgi
« Reply #2 on: June 21, 2007, 12:34:56 PM »
I had this problem when vtiger was executed with php4 (the default php of SME). As soon as I've installed php5-cgi and configured vtiger to be handled by php5-cgi, everything worked perfectly. You can verify if vtiger is handled by php5-cgi, just log into your server and type the command 'htop', you should see all the different process. Now, open your web browser and log into vtiger. While the page is loading, you should see the process /usr/bin/php5/php which take a lot of CPU.

Where did you install vtiger? in a ibay?
Have you change this

Code: [Select]

<Directory /home/e-smith/files/ibays/vtiger/html>
       AddHandler php5-cgi .php
       Action php5-cgi /php5-cgi/php
</Directory>


To match your installation?
C'est la fin du monde !!! :lol:

it4orce

[How-to] install php5-cgi
« Reply #3 on: June 21, 2007, 01:08:04 PM »
Thanks for the response, i think i see where it it going wrong.

in htop i do not see the php process, as you describe

Please excuse my ignorance, but this is what i found :

if i do :

nano /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/90vtiger

it is empty, so i enter :

<Directory /home/e-smith/files/ibays/vtiger/html>
       AddHandler php5-cgi .php
       Action php5-cgi /php5-cgi/php
</Directory

when i save i get this :

[ Could not open file for writing: No such file or directory ]

but, if i browse to /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf and "ls -l" i see the 90vtiger file.

[root@it4-01 /]# cd /etc/e-smith/templates-custom/etc/httpd/conf          
[root@it4-01 conf]# ls -l
total 4
drwxr-xr-x  2 root root 4096 Jun 21 13:01 http.conf
[root@it4-01 conf]# cd http.conf/
[root@it4-01 http.conf]# ls -l
total 8
-rw-r--r--  1 root root 132 Jun 21 12:54 90vtiger
[root@it4-01 http.conf]#
 

if i nano 90vtiger i see :

<Directory /home/e-smith/files/ibays/vtiger/html>
       AddHandler php5-cgi .php
       Action php5-cgi /php5-cgi/php
</Directory>

I'm at a loss as to why this is happening , any ideas ?

it4orce

[How-to] install php5-cgi
« Reply #4 on: June 21, 2007, 04:36:21 PM »
Ok,

I re-installed a clean copy of sme and re installed vtiger and php5 as a cgi, BUT

When i get to the steps :

vim /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/90vtiger

and put in the following lines in this file

<Directory /home/e-smith/files/ibays/vtiger/html>
       AddHandler php5-cgi .php
       Action php5-cgi /php5-cgi/php
</Directory>

i get this error with vi: "/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/90vtiger" E212: Can't o
pen file for writing

and this error with nano :[ Could not open file for writing: No such file or directory ]

Can anyone see where i am going wrong ? any help would REALLY be appreciated !

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
[How-to] install php5-cgi
« Reply #5 on: June 21, 2007, 04:41:38 PM »
I forgot to put in the how-to
Code: [Select]

mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf


just before
Code: [Select]
vim /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/90vtiger
C'est la fin du monde !!! :lol:

it4orce

[How-to] install php5-cgi
« Reply #6 on: June 21, 2007, 04:51:31 PM »
Great it is working !

Thank you.

( For the record, i did try create those folders, but i obviously screwed something up as it didnt work out. )

vtiger is now detecting php 5.1.2

Thank you so much for your time and your site http://sme.firewall-services.com rocks !

---rv---

[How-to] install php5-cgi
« Reply #7 on: June 24, 2007, 09:08:46 AM »
Hello and thank you for this work.
nb : I installed EGV1.2 on / opt by following this http://forums.contribs.org/index.php?topic=35146.0 topic, and then I follow by the update in 1.4 with that one : http://forums.contribs.org/index.php?topic=37313.0.

When i get to the steps :
vim /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/92egroupware
and put in the following lines in this file :
<Directory /opt/egroupware/html>
AddHandler php5-cgi .php
Action php5-cgi /php5-cgi/php
</Directory>

I can notice that php5 is activated for egroupware, but only the banniere is visible the applications (email, contact etc.) do not appear any more.
In brief, that does not work and I think that it is because of redirections.
Of what do you think of it?

Thank you for your comments and your help.
@+ rv

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
[How-to] install php5-cgi
« Reply #8 on: June 24, 2007, 10:44:21 AM »
I had the same problem as I run egw1.4 on a server with php5-cgi. Just edit the file /etc/php5/php.ini and change the memory_limit (it's 8M by default). On my server I've put 50M, maybe you can try with less.
Once this is done, restart httpd:

svc -t /service/httpd-e-smith

Cheers
C'est la fin du monde !!! :lol:

---rv---

[How-to] install php5-cgi
« Reply #9 on: June 24, 2007, 11:24:29 AM »
Hip Hip hourra !
Your analysis of the problem is correct and it works well with memory_limit at 50M.
Thks

---rv---

[How-to] install php5-cgi
« Reply #10 on: June 24, 2007, 08:38:50 PM »
Still I.
I have a supplementary question: as I read this subject http://www.egroupware.org/index.php?page_name=wiki&wikipage=SyncMLInstallHowTo it's necessary to create a template like this:
Quote
<Directory /opt/egroupware/rpc.php>
       AddHandler php5-cgi .php
       Action php5-cgi /php5-cgi/php
</Directory>

What do you think?
Thank you

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
[How-to] install php5-cgi
« Reply #11 on: June 25, 2007, 09:34:58 AM »
If all your egroupware is handled by php5-cgi, there's no need to add this, rpc.php will also be handled by php5-cgi, the sync is working for me with funambol plugin for outlook (tested with funambol 3 and outlook 2003 and 2007)
C'est la fin du monde !!! :lol:

Offline gyrcom

  • 20
  • +0/-0
    • https://www.gidout.com
[How-to] install php5-cgi
« Reply #12 on: July 09, 2007, 11:02:01 PM »
This process seems to work very well for Ibays. I've just done an installation of sugar and I am very happy.
At first I tried to get this to work in a folder in the primary html area and it failed.
So I'm using an Ibay
Thanks for this solution
...

Offline berdie

  • *
  • 237
  • +0/-0
[How-to] install php5-cgi
« Reply #13 on: July 11, 2007, 12:57:48 PM »
I would like to build a new rpm for eGW 1.4 with php5 as cgi module included. Playing around with your solution, I found 2 issues:

1. UTF8

The prepared database uses UTF8 to avoid errors, so it's necessary to use the mbstring.func_overload=7 value. Unfortunally there is no mbstring.mo modul in the /usr/lib/php5 extension directory. Is mbstring available as php-cgi modul and useable in hybrid mode with php4 together?

2. Pear is checked ok, but with Auth_SASL = false

How can I change Auth_SASL to true?

Rgds.,
Dietmar

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
[How-to] install php5-cgi
« Reply #14 on: July 13, 2007, 05:05:29 PM »
Quote from: "berdie"
I would like to build a new rpm for eGW 1.4 with php5 as cgi module included. Playing around with your solution, I found 2 issues:

1. UTF8

The prepared database uses UTF8 to avoid errors, so it's necessary to use the mbstring.func_overload=7 value. Unfortunally there is no mbstring.mo modul in the /usr/lib/php5 extension directory. Is mbstring available as php-cgi modul and useable in hybrid mode with php4 together?

2. Pear is checked ok, but with Auth_SASL = false

How can I change Auth_SASL to true?

Rgds.,
Dietmar


Well, for mbstring, it seems that these rpms are compiled without mbstring support. In fact, I haven't compiled it myself, I've found them here: http://www.seekbrain.com/downloads/legacy/psa/4ES/

For SASL, I don't, I haven't take the time to check this. The best would be to recompile a more recent version of php, with mbstring support and SASL. I think it should be quite simple to change the srpms from centosplus repo:
- the name of the rpm (php5 to php5-cgi)
- disabled the compilation of apache mod


I think I won't have the time to do it before some weeks at least, so if someone is interested in doing that...
C'est la fin du monde !!! :lol: