Koozali.org: home of the SME Server

[HOWTO] Egroupware and SyncML without upgrading to PHP5

Offline kb-ohnemus

  • ****
  • 154
  • +0/-0
    • http://www.kb-ohnemus.de
[HOWTO] Egroupware and SyncML without upgrading to PHP5
« on: February 23, 2007, 09:54:55 PM »
Edit: I changed a few things. The new Howto is below in the fourth posting

Hi,

after installing egroupware by using this great HOWTO http://forums.contribs.org/index.php?topic=35146.0 (thanks)
I noticed I was not able to use SyncML because there is only PHP4 and updating SME to PHP5 seems not to be an easy task.

So, here http://www.egroupware.org/index.php?page_name=sync&wikipage=SyncMLInstallHowto I found something about using php5-cgi.

I took php5-fastcgi and php5-mysql from SuSE10. Because of some failed dependencies I couldn't install the rpms directly so I extracted them and copied the files to the system directly. I collected all the files in this tgz:
http://kb-ohnemus.de/div/files.tgz

Extract it somewhere and do the following:
Code: [Select]

mkdir /etc/php5

mkdir /etc/php5/conf.d
cp mysql.ini /etc/php5/conf.d

mkdir /etc/php5/fastcgi
cp php.ini /etc/php5/fastcgi

mkdir /usr/lib/php5
mkdir /usr/lib/php5/extensions

cp mysql /usr/lib/php5/extensions

cp php5 /home/e-smith/files/ibays/Primary/cgi-bin

This one tells rpc.php to use php5-fastcgi instead of php4:
Code: [Select]

cp 99php5 /etc/e-smith/templates/etc/httpd/conf/httpd.conf

expand-template /etc/httpd/conf/httpd.conf

service httpd-e-smith restart

SyncML had some problems finding PEAR.php, so I changed:
Code: [Select]

vim /opt/egroupware/html/phpgwapi/inc/horde/lib/core.php

on line 27:
Code: [Select]

include_once '/usr/share/pear/PEAR.php';

Code: [Select]

vim /opt/egroupware/html/phpgwapi/inc/horde/Horde.php

on line 3:
Code: [Select]

include_once '/usr/share/pear-addons/Log.php';

Code: [Select]

vim /opt/egroupware/html/phpgwapi/inc/horde/Horde/iCalendar.php

on line 155:
Code: [Select]

require_once '/usr/share/pear/PEAR.php';

I guess there are better ways than "hardcoding" the paths, but so far I didn't figure out.

That's it. Point any Browser to https://your-server/egroupware/rpc.php
It should only say: You should access this URL only with a SyncML enabled device.

So, backup your egroupware-database in case something goes wrong.

Point your SyncML-device to https://your-server/egroupware/rpc.php

Username and Password are the same as for logging into egroupware of course.

Server-Paths:
Code: [Select]

./contacts
./calendar
./tasks
./notes

Then do a "reload device" for each of the four. You will loose all the devices previous data, but this is important for having consistent data. I had no success merging differing server and device data. This will take a while.

If reloading the device stops somewhere in between
Code: [Select]

vim /etc/php5/fastcgi/php.ini

and set memory_limit on line 300 to something reasonable, for me it worked with 80M.

After reloading the device you should be able to use "normal" sync.

This works without any problems on my palm-powered gsl xplore m68 using Synthesis-SyncML-Client-Software over GPRS or Bluetooth.

If I have missed anything, tell me.

Happy syncing...
Manuel

Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
[HOWTO] Egroupware and SyncML without upgrading to PHP5
« Reply #1 on: February 24, 2007, 05:37:48 PM »
Editing egroupware files would have to be done after every update?
Could it be possible to use this kind of code:
Code: [Select]
ibayname="egroupware"
db accounts setprop $ibayname PHPBaseDir /home/e-smith/files/ibays/$ibayname:/usr/share/pear-addons:/usr/share/pear
Sophie from Montréal

Offline yythoss

  • *
  • 532
  • +0/-0
    • http://www.hylafax-client.de
[HOWTO] Egroupware and SyncML without upgrading to PHP5
« Reply #2 on: February 25, 2007, 11:17:25 PM »
If I call:

Code: [Select]
https://192.168.201.100/egroupware/rpc.php

my Webbrowser show this message:

Code: [Select]
Fatal Error: It appears that you have not created the database tables for eGroupWare. Click here to run setup.

My status from the setup is OK and my database is working with egroupware. The Logfile show this messages:

Code: [Select]
Feb 25 23:07:03 smeserver php5: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: undefined symbol: OnUpdateInt in Unknown on line 0
Feb 25 23:07:03 smeserver php5: PHP Warning:  dl() [<a href='function.dl'>function.dl</a>]: Unable to load dynamic library '/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: undefined symbol: OnUpdateInt in /opt/egroupware/html/phpgwapi/inc/class.egw_db.inc.php on line 261
Feb 25 23:07:03 smeserver php5: PHP Warning:  dl() [<a href='function.dl'>function.dl</a>]: Unable to load dynamic library '/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: undefined symbol: OnUpdateInt in /opt/egroupware/html/phpgwapi/inc/class.egw_db.inc.php on line 261
Feb 25 23:07:03 smeserver php5: PHP Warning:  dl() [<a href='function.dl'>function.dl</a>]: Unable to load dynamic library '/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: undefined symbol: OnUpdateInt in /opt/egroupware/html/phpgwapi/inc/class.egw_db.inc.php on line 261


Can you help me?

Offline kb-ohnemus

  • ****
  • 154
  • +0/-0
    • http://www.kb-ohnemus.de
[HOWTO] Egroupware and SyncML without upgrading to PHP5
« Reply #3 on: March 25, 2007, 08:54:43 AM »
@soprom: I added the paths for Pear and Pear-log to /etc/php5/fastcgi/php.ini. So no changes to /opt/egroupware are necessary.

@yythoss: php5-fastcgi can't find /usr/lib/php5/extensions/mysql. Line 511 in /etc/php5/fastcgi/php.ini should be:  extension_dir = /usr/lib/php5/extensions

This is the actual Howto. Use the new files from my website.

1. Install egroupware using this Howto.
http://forums.contribs.org/index.php?topic=35146.0

2. Download the files needed for php5-fastcgi and extract them somewhere:
http://kb-ohnemus.de/div/php5-fastcgi_for_SME7.1.tgz

3. Then do the following:
Code: [Select]

mkdir /etc/php5
mkdir /etc/php5/conf.d
cp mysql.ini /etc/php5/conf.d

mkdir /etc/php5/fastcgi
cp php.ini /etc/php5/fastcgi

mkdir /usr/lib/php5
mkdir /usr/lib/php5/extensions
cp mysql /usr/lib/php5/extensions

cp php5 /home/e-smith/files/ibays/Primary/cgi-bin

cp 99php5 /etc/e-smith/templates/etc/httpd/conf/httpd.conf

expand-template /etc/httpd/conf/httpd.conf

service httpd-e-smith restart



4. For testing point any Browser to https://your-server/egroupware/rpc.php
It should only say: You should access this URL only with a SyncML enabled device.

5. Backup your egroupware-database in case something goes wrong.

6. Sync:

Point your SyncML-device to https://your-server/egroupware/rpc.php

Username and Password are the same as for logging into egroupware of course.

Server-Paths:
Code: [Select]

./contacts
./calendar
./tasks
./notes

Then do a "reload device" for each of the four. You will loose all the devices previous data, but this is important for having consistent data. I had no success merging differing server and device data. This will take a while.

After reloading the device you should be able to use "normal" sync.

Note: If something doesn't work as expected have a look at /var/log/httpd/error_log and /tmp/egroupware_syncml.log. SyncML produces quite usable error-messages.

Note: This will only work if SQL-authetication enabled.
Meanwhile I use Mail-authentication (egroupware uses  the Imap-server to authenticate, so egroupware-users are created automatically). This requires some further work for syncing. I'll desribe later.

Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
[HOWTO] Egroupware and SyncML without upgrading to PHP5
« Reply #4 on: March 25, 2007, 09:06:12 PM »
First, many thanks for these instructions! This solution is just great!

I had to create an ibay to manage the default domain cgi since Primary is owned admin:shared.
I installed egw with utf-8 character set


Note:
Using Funambol (Sync4j), the recommended folders are :
    * Contact Name: ./sifcontacts
    * Calendar Name: ./sifcalendar
    * Task Name: ./siftasks
    * Note Name: ./sifnotes (? it looks that its not yet implemented)


Also, a note about editing egroupware source code:
This would have to be done after updates and would not be a workable solution.

A question:
What do you mean by "This will only work if SQL-authetication enabled" ?

Funambol does not work so far...
Sophie from Montréal

Offline kb-ohnemus

  • ****
  • 154
  • +0/-0
    • http://www.kb-ohnemus.de
[HOWTO] Egroupware and SyncML without upgrading to PHP5
« Reply #5 on: March 25, 2007, 09:54:13 PM »
Quote from: "soprom"
I had to create an ibay to manage the default domain cgi since Primary is owned admin:shared.
I installed egw with utf-8 character set


I have no idea about that, for my fresh 7.1 install it just worked by copying it to the primary ibay.

Quote from: "soprom"

Note:
Using Funambol (Sync4j), the recommended folders are :
    * Contact Name: ./sifcontacts
    * Calendar Name: ./sifcalendar
    * Task Name: ./siftasks
    * Note Name: ./sifnotes (? it looks that its not yet implemented)


I just tested with Synthesis for Palm OS. I'm still looking for a solution to sync Outlook. Does Funambol for Outlook work? I could not get that to work so far, I think its a problem with the certificate.

Quote from: "soprom"

Also, a note about editing egroupware source code:
This would have to be done after updates and would not be a workable solution.


I know, that's the reason I changed it. But the roadmap for egroupware plans major changes in SyncML for egroupware 1.4, so we can't be sure about upgrades anyway.

Quote from: "soprom"

A question:
What do you mean by "This will only work if SQL-authetication enabled" ?


That's the default authentication method in egroupware. Users are created  manually and stored in the database. You can change that to Mail-authentication in setup/config.php. If a new user logs into egroupware username and password are looked up in the imap-server and then the egroupware-user is created automatically. For SyncMl you additionally  need /usr/lib/php5/extensions/imap (which I can provide) and set some symlinks (which I will have to look up again)

Offline schratikus

  • 1
  • +0/-0
[HOWTO] Egroupware and SyncML without upgrading to PHP5
« Reply #6 on: April 04, 2007, 10:27:04 PM »
@kb-ohnemus:
Thank you for your work so far! I have not yet tested it on my server but would do so, if you could provide the infos you mentioned concerning mail-auth (which i am using).
So, could you provide the necessary files (/usr/lib/php5/extensions/imap) and the symlinks to set? Thank you!

Offline kb-ohnemus

  • ****
  • 154
  • +0/-0
    • http://www.kb-ohnemus.de
[HOWTO] Egroupware and SyncML without upgrading to PHP5
« Reply #7 on: April 05, 2007, 02:02:59 AM »
Sorry, been a bit busy the last days, so:

Additionally if you use Mail-Authentication:

Download http://kb-ohnemus.de/div/php5-fastcgi_imap.tgz

Extract it and copy it to:
Code: [Select]
cp imap /usr/lib/php5/extensions

This file was taken from OpenSuSE10, some libs are named differently there, so you need four symlinks for php5-fastcgi to find the correct libs:

Code: [Select]

ln -s /usr/lib/libc-client.so.0 /usr/lib/libc-client.so
ln -s /usr/lib/libkrb5.so.3.2 /usr/lib/libkrb5support.so.0
ln -s /lib/libssl.so.0.9.7a /lib/libssl.so.0.9.7
ln -s /lib/libcrypto.so.0.9.7a /lib/libcrypto.so.0.9.7


These symlinks should work for SME 7.1.3.

Again, if something doesn't work have a look at /var/log/httpd/error_log and /tmp/egroupware_syncml.log.

steffprevot197

pb with function.dl
« Reply #8 on: April 24, 2007, 11:35:38 AM »
I have make a new installation of SME 7.1
I have installed egroupware with your howto:


Quote
1. Install egroupware using this Howto.
http://forums.contribs.org/index.php?topic=35146.0

2. Download the files needed for php5-fastcgi and extract them somewhere:
http://kb-ohnemus.de/div/php5-fastcgi_for_SME7.1.tgz

3. Then do the following:
Code:

mkdir /etc/php5
mkdir /etc/php5/conf.d
cp mysql.ini /etc/php5/conf.d

mkdir /etc/php5/fastcgi
cp php.ini /etc/php5/fastcgi

mkdir /usr/lib/php5
mkdir /usr/lib/php5/extensions
cp mysql /usr/lib/php5/extensions

cp php5 /home/e-smith/files/ibays/Primary/cgi-bin

cp 99php5 /etc/e-smith/templates/etc/httpd/conf/httpd.conf

expand-template /etc/httpd/conf/httpd.conf

service httpd-e-smith restart

4. For testing point any Browser to https://your-server/egroupware/rpc.php


But when i go to https://your-server/egroupware/rpc.php
my Webbrowser show this message:
Quote
Warning: dl() [function.dl]: Dynamically loaded extensions aren't allowed when running in Safe Mode in /opt/egroupware/html/phpgwapi/inc/class.egw_db.inc.php on line 261
Fatal Error: It appears that you have not created the database tables for eGroupWare. Click here to run setup.


when i go to
Quote
/var/log/httpd/error_log and /tmp/egroupware_syncml.log.

I see
Quote
[Tue Apr 24 11:07:19 2007] [error] [client 192.168.141.220] File does not exist: /opt/egroupware/html/function.dl, referer: https://192.168.141.63/egroupware/rpc.php


Can you help me ?
Thanks and scuse for my english !

Offline kb-ohnemus

  • ****
  • 154
  • +0/-0
    • http://www.kb-ohnemus.de
[HOWTO] Egroupware and SyncML without upgrading to PHP5
« Reply #9 on: April 24, 2007, 12:13:07 PM »
It looks as if your php4 (the one provided by SME-Server) would run in safe mode and therefore does not load extensions.

You could change this by editing
/etc/e-smith/templates/etc/php.ini/10LanguageOptions

Linie13:
safe_mode = Off

and comitting this by:
expand-template /etc/php.ini

BUT: My php-installation runs in safe_mode = Off by default and I suppose you have changed that to On intentionally because of other installed software depending on php. So setting it to Off may break something else?

Offline kb-ohnemus

  • ****
  • 154
  • +0/-0
    • http://www.kb-ohnemus.de
[HOWTO] Egroupware and SyncML without upgrading to PHP5
« Reply #10 on: April 24, 2007, 12:54:46 PM »
BTW: Centos5 is out and contains php5 by default. So somewhen (are there any plans?) SME will be based on Centos5 and this php-fastcgi-thing will become obsolete...

steffprevot197

pb with function.dl
« Reply #11 on: April 24, 2007, 04:08:05 PM »
when i see my
Quote
/etc/e-smith/templates/etc/php.ini/10LanguageOptions
i see:
Quote
# Language Options ;
#;;;;;;;;;;;;;;;;;;;}
engine                  =       On
short_open_tag  =       On      ;
asp_tags                =       Off
precision               =       14
y2k_compliance  =       Off
output_buffering        = Off
output_handler          =
implicit_flush          = Off
allow_call_time_pass_reference  = On
safe_mode               =       Off
safe_mode_exec_dir      =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
disable_functions       =
highlight.string        =       #DD0000
highlight.comment       =       #FF8000
highlight.keyword       =       #007700
highlight.bg            =       #FFFFFF
highlight.default       =       #0000BB
highlight.html          =       #000000
expose_php      =       On


and so i don't understand why i have this message
Thanks

Offline bpivk

  • *
  • 908
  • +0/-0
    • http://www.bezigrad.com
[HOWTO] Egroupware and SyncML without upgrading to PHP5
« Reply #12 on: April 24, 2007, 04:28:53 PM »
Quote from: "kb-ohnemus"
BTW: Centos5 is out and contains php5 by default. So somewhen (are there any plans?) SME will be based on Centos5 and this php-fastcgi-thing will become obsolete...

AFAIK it will be implemented in SME 8 which is at this moment (i think) in pre-Alpha.
"It should just work" if it doesn't report it. Thanks!

Offline kb-ohnemus

  • ****
  • 154
  • +0/-0
    • http://www.kb-ohnemus.de
Re: pb with function.dl
« Reply #13 on: April 25, 2007, 12:48:43 PM »
Quote from: "steffprevot197"
and so i don't understand why i have this message


Hm, I'm not very familiar with php so I have no idea. Maybe you could ask in the egroupware-forum?

http://www.nabble.com/eGroupWare-f3741.html

---rv---

[HOWTO] Egroupware and SyncML without upgrading to PHP5
« Reply #14 on: April 30, 2007, 09:20:50 AM »
Hi,
I'm looking for long time to sync my qteck with egw so I thank you for this job ... but I cannot reach https://myserver/egroupware/rpc.php .

It's a brand new  SME Server 7.1.3 with eGroupWare using cool34's howto and php5-fastcgi using your howto (forth position of this threat)

nota : xmlrpc is activate and I used this howto http://wiki.contribs.org/Custom_CA_Certificate to avoid security alerte on https.

But when i go to https://myserver/egroupware/rpc.php
my Webbrowser show this message:
Quote
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.


And when i go to
Quote
/var/log/httpd/error_log and /tmp/egroupware_syncml.log.


I see
Quote
[Mon Apr 30 09:13:52 2007] [error] [client 192.168.151.4] (13)Permission denied: exec of '/home/e-smith/files/ibays/Primary/cgi-bin/php5' failed
[Mon Apr 30 09:13:52 2007] [error] [client 192.168.151.4] Premature end of script headers: php5


Can you help me ?
Thks