Installing iHRIS on Ubuntu 10.4 (Lucid): Difference between revisions

From IHRIS Wiki
No edit summary
Line 26: Line 26:
apc.shm_size=100
apc.shm_size=100
apc.write_lock=1
apc.write_lock=1
apc-slam_defense=0
apc.slam_defense=0
</source>
</source>



Revision as of 09:24, 30 August 2010

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

APC

To compile pecl packages yourself you'll need these packages installed. They may already be installed. <source lang="bash"> sudo apt-get install php5-dev apache2-prefork-dev </source>

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>

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>

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>