Include System/Daemon for Pear

apps

#1

Hi Guys,

I am having troubles include the System_Daemon library in http://pear.php.net/package/System_Daemon package from Pear.

I followed the WiKi and here is my code.

[code]
define(‘PATH_SEPERATOR’,’:…’);
set_include_path( ‘.’ . PATH_SEPERATOR . ‘/home/realin/pear/php’ . PATH_SEPERATOR . get_include_path() );
//works corect
require_once “System.php”;
var_dump(class_exists(‘System’));

//does not work
require_once “System/Daemon.php”;
var_dump(class_exists(‘Daemon’));[/code]

How ever the require_once “System/Daemon.php”; works on my local system i.e. Ubuntu.

What could be the reason ?

Thanks
Sachin Khosla


#2

First of all, “:…” is a totally bogus path separator, and it’ll mess you up in all kinds of bizarre ways. Should simply be “:”.

Second of all, have you installed System_Daemon to your DreamHost account? It’s not installed by default.


#3

Hi Andrew,

Thanks for the reply. I tried to install, but it gave me error.

WARNING: failed to download pear.php.net/System_Daemon within preferred state “stable”, will instead download version 1.0.0RC1, stability "beta"
Cannot install, php_dir for channel “pear.php.net” is not writeable by the current user

I am on Dreamhost’s shared hosting account. And when i did

pear list-all , it gave me

pear/System_Daemon 1.0.0RC1 Turn PHP scripts into Linux daemons

Thanks for the help !


#4

pear list-all is listing “all” packages which could be installed, not just the ones that are currently installed.

http://wiki.dreamhost.com/PEAR has some details on installing PEAR packages. I haven’t tested them myself.

Also, note that running persistent processes (or “daemons”) on shared hosting accounts isn’t permitted. You will need to sign up for DreamHost VPS or a dedicated server to run that sort of thing.