Installing iHRIS on Ubuntu 10.4 (Lucid)

From IHRIS Wiki
Revision as of 10:20, 14 May 2010 by Lduncan (talk | contribs) (→‎APC)

Ubuntu 10.4 comes with PHP 5.3 so there a few a few issues that need to be corrected.

APC

The version of APC that ships with 10.4 causes problems. You'll need to downgrade it for it to work. When it asks if you want to use the spin locks type in yes. Run the following commands in a terminal: <source lang="bash"> sudo apt-get remove php-apc sudo pecl config-set preferred_state beta sudo pecl install APC-3.1.2 sudo pecl config-set preferred_state stable </source>

If you get errors about missing phpize then you need to install php5-dev by: <source lang="bash"> sudo apt-get install php5-dev </source> If you get errors about apxs then you need to install the apache development package: <source lang="bash"> sudo apt-get install apache2-prefork-dev </source>

Now you need to set the configuration options for APC. Create or edit the ini file by typing: <source lang="bash"> sudo gedit /etc/php5/conf.d/apc.ini </source>

The contents should be: <source lang="ini"> extension=apc.so apc.shm_size=100 apc.write_lock=1 apc-slam_defense=0 </source>

Sessions

Now you need to set the session save path. The default is /tmp but that is causing problems and the script to clean up sessions doesn't look there. You'll need to edit the files for apache and cli and make the same change. To edit the apache php config type: <source lang="bash"> sudo gedit /etc/php5/apache2/php.ini </source>

Find the line that looks like: <source lang="ini">

session.save_path = "/tmp"

</source> And change it to be (don't forget to remove the semi-colon): <source lang="ini"> session.save_path = "/var/lib/php5" </source>

Now edit the cli config file and make the same change: <source lang="bash"> sudo gedit /etc/php5/cli/php.ini </source>

Overloaded Functions

Until the code can be updated, you'll need to change a few functions in one file. If you're using the 4.0.4 or before you'll need to make this change. The development code and any future releases won't need this change. You'll need to edit your I2CE_Form.php file which is under I2CE/modules/Forms/lib depending on where you installed I2CE.

The functions __get, __set, __isset and __unset need to be changed from protected to public. For example: <source lang="php"> protected function __get( $key ) { </source> Should now be: <source lang="php"> public function __get( $key ) { </source>

You should make this change for all the functions listed above.

Restart

Now restart apache and memcached (if you're using it) and try to access your site again. <source lang="bash"> sudo /etc/init.d/apache2 restart sudo /etc/init.d/memcached restart </source>