Partkeepr

From emboxit
Jump to: navigation, search

php.ini

;below line uncommented for PartKeeper, NIKOS
extension=php_fileinfo.dll


XAMPP tutorial Win7

Hello there, today I finally managed to pass Partkeepr Setup. I'm running Win7 x64

Heres what I've done:

0. Install XAMPP

Installed: XAMPP for Windows 1.8.1, 30.9.2012 Installer

I didn't want to install Xampp to C: drive, so I had to change some settings just after the installation finished, as I will show you here. I choosed "E:\xampp" as install dir. Probably you have to change this to your configuration.

1. Get Imagick (ImageMagick PHP API) working

Download imagick-php54-php53.tgz from http://valokuva.org/?p=197 Open this file, navigate to imagick/ImageMagick-6.8.0-vc9/ this folder contain a lot of DLL-files. Extract them to a folder somewhere on your system, but remember the Path. I extracted them to E:\xampp\DLLPATH\

You have to add this folder to your PATH-variable as described here But don't overwrite the containing values in PATH, just add yours.

Now grab your php_imagick.dll here (PHP 5.4 Thread Safe)

Move this file to "E:/xampp/php/ext"

Next open E:\xampp\php\php.ini scroll to the bottom of this file and add:

    extension=php_imagick.dll
    extension=php_fileinfo.dll


Imagick should now be working.

2. Get DoctrineORM and Twix running

To get Doctrine running I needed more than two frustrating days. :( To have a correctly working pear.ini is very important. Open E:\xampp\php\pear.bat and change

    IF "%PHP_PEAR_INSTALL_DIR%"=="" SET "PHP_PEAR_INSTALL_DIR=E:\xampp\php\pear"
    IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=E:\xampp\php"
    IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=E:\xampp\php\.\php.exe"

    GOTO :INSTALLED

to

    IF "%PHP_PEAR_INSTALL_DIR%"=="" SET "PHP_PEAR_INSTALL_DIR=E:\xampp\php\pear"
    IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=E:\xampp\php"
    IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=E:\xampp\php\.\php.exe"
    IF "%PHP_PEAR_SYSCONF_DIR%"=="" SET "PHP_PEAR_SYSCONF_DIR=E:\xampp\php"

    GOTO :INSTALLED


then open a 'cmd', navigate to E:\xampp\php\ and execute the following commands:

    pear config-set doc_dir E:\xampp\php\pear\docs
    pear config-set cfg_dir E:\xampp\php\pear\cfg
    pear config-set data_dir E:\xampp\php\pear\data
    pear config-set test_dir E:\xampp\php\pear\tests
    pear config-set www_dir E:\xampp\php\pear\www

    pear channel-discover pear.symfony.com
    pear channel-discover pear.doctrine-project.org

    pear update-channels

    pear clear-cache


Ubuntu setup

Ubuntu setup from Technology Realm blog

1. Install apache, mysql, php, imagemagick

   sudo apt-get install apache2 mysql-server mysql-client libapache2-mod-php5 php5-mysql php5-curl php5-cli php-pear php5-imagick php5-xsl php-apc php5-dev imagemagick git

2. Download, extract, copy to /var/www and set correct permissions

   wget http://partkeepr.org/downloads/partkeepr-0.1.9.zip
   unzip partkeepr-0.1.9.zip 
   sudo cp -r ./partkeepr-0.1.9 /var/www/
   sudo chmod -R 777 /var/www/partkeepr-0.1.9/

3. Update PEAR

   pear update-channels
   sudo pear upgrade


4. Install phpunit, phing, doctrine components and twig. During the installation, it could happen that the ImageMagick library gets pulled in via PECL. Just hit enter on each question and ignore if it fails; as long as you've got php5-imagick installed, you're set.

   pear config-set auto_discover 1
   sudo pear install pear.phpunit.de/PHPUnit pear.phpunit.de/phpcpd pear.phing.info/phing pear.doctrine-project.org/DoctrineORM pear.doctrine-project.org/DoctrineSymfonyYaml pear.doctrine-project.org/DoctrineSymfonyConsole pear.twig-project.org/Twig
   sudo pear install --alldeps phpmd/PHP_PMD-alpha


5. We also need jsl, the JavaScript lint

   sudo apt-get install nodejs
   sudo apt-get install npm
   npm config set registry http://registry.npmjs.org/
   sudo npm install -g jslint


6. From the browser, go to http://localhost/partkeepr-0.1.9/setup/ and click Next

7. In the prerequisite check, I got "You are missing the GD library for PHP. Please install and activate it.".

So to install GD Library, install php5-gd

   sudo apt-get install php5-gd


8. Click Re-run checks. Now, again I got "The PHP timezone () is not set or invalid. Please set the correct timezone in your php.ini file (don't forget to restart the web server afterwards)".

So, set the correct timezone in php.ini

   sudo nano /etc/php5/apache2/php.ini

Uncomment "date.timezone =" and set timezone ap per the supported timezones (here: http://in3.php.net/manual/en/timezones.php) For example : date.timezone = UTC Save the file and restart the apache server:

   sudo /etc/init.d/apache2 restart

Now, again Re-run Checks. This time I got all success. Click Nex

9. Now, we have to create a database for PartKeepr, you can either use the form to get the desired commands for creating database or, simply enter the commands below in your shell:

   mysql -uroot -p
   CREATE DATABASE partkeepr CHARACTER SET utf8;
   grant usage on *.* to partkeepr@localhost identified by 'partkeepr';
   grant all privileges on partkeepr.* to partkeepr@localhost;
   quit

10. Now, fill the form as in screenshot and click next

11. If Database Connectivity Test is OK, then proceed.

12. Wait till the PartKeepr installation is set-up, then click Next:

13. Save the configuration either through browser (if it is writable) or manually. I selected 1st option and the file got saved successfully:

14. The next step is to setup Cron jobs:

   crontab -e

If it asks to select your editor, select anyone of your liking. Enter the commands as shown in screenshot of Installation and Console:

   0 0,12 * * * /usr/bin/php <path-to-partkeepr>/cronjobs/CreateStatisticSnapshot.php
   0 0,6,12,18 * * * /usr/bin/php <path-to-partkeepr>/cronjobs/UpdatePartCacheData.php
   0 0 */2 * * /usr/bin/php <path-to-partkeepr>/cronjobs/CheckForUpdates.php
   0 0 */2 * * /usr/bin/php <path-to-partkeepr>/cronjobs/UpdateTipsOfTheDay.php
Save the file.

15. Return to Browser and click Next. It should tell that setup is complete.

16. Go to http://localhost/partkeepr-0.1.9/frontend/ and login. Default username/password is admin/admin:

17. And Voila!, you now have a working PartKeepr Installation! Congratulations!