{"id":243,"date":"2009-04-01T17:59:59","date_gmt":"2009-04-01T10:59:59","guid":{"rendered":"http:\/\/adityo.blog.binusian.org\/?p=243"},"modified":"2009-04-15T11:28:13","modified_gmt":"2009-04-15T04:28:13","slug":"how-to-install-eaccelerator-to-php-524-2ubuntu55-with-suhosin-patch-0962-cli-on-ubuntu-8042hardy","status":"publish","type":"post","link":"https:\/\/adityo.blog.binusian.org\/?p=243","title":{"rendered":"How to install eAccelerator to PHP 5.2.4-2ubuntu5.5 with Suhosin-Patch 0.9.6.2 (cli) on Ubuntu 8.04.2(hardY)"},"content":{"rendered":"<p style=\"text-align: justify;\">What is eAccelerator ?<\/p>\n<p style=\"text-align: justify;\">is a free open-source PHP accelerator, optimizer, and dynamic content cache. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. <span class=\"searchword0\">eAccelerator<\/span> typically reduces server load and increases the speed of your PHP code by 1-10 times.<\/p>\n<p style=\"text-align: justify;\">When i heard that then in my mind why didn&#8217;t try to install it on my blog server, i feel that my blog performance was not fast enough and i think eaccelerator maybe the solution for it.<\/p>\n<p style=\"text-align: justify;\">I assume you have already installed php on your server and checked your php version<\/p>\n<p style=\"text-align: justify;\">root@monitor-ubuntu:~# php -v<\/p>\n<p style=\"text-align: justify;\">PHP 5.2.4-2ubuntu5.5 with Suhosin-Patch 0.9.6.2 (cli) (built: Feb 11 2009 20:09:52)<\/p>\n<p style=\"text-align: justify;\">Copyright (c) 1997-2007 The PHP Group<\/p>\n<p style=\"text-align: justify;\">Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies<\/p>\n<p style=\"text-align: justify;\">or you can checked it on your phpinfo, just create a file named test.php then add this<\/p>\n<p style=\"text-align: justify;\">&lt;? phpinfo(); ?&gt;<\/p>\n<p style=\"text-align: justify;\">then checked it on your browser http:\/\/localhost\/test.php<\/p>\n<h2 class=\"editable\" style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-247\" title=\"eaccel11\" src=\"http:\/\/adityo.blog.binusian.org\/files\/2009\/04\/eaccel11.png\" alt=\"eaccel11\" width=\"600\" height=\"749\" srcset=\"https:\/\/adityo.blog.binusian.org\/files\/2009\/04\/eaccel11.png 600w, https:\/\/adityo.blog.binusian.org\/files\/2009\/04\/eaccel11-240x300.png 240w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/h2>\n<h2 class=\"editable\" style=\"text-align: justify;\">Prerequisites<\/h2>\n<p style=\"text-align: justify;\">The installation of <span class=\"highlight\">eAccelerator<\/span> on <span class=\"highlight\">Ubuntu<\/span> 8.04 will require that several program packages be installed on your system.\u00a0 <span>php5-dev<\/span> is required to get the program <span>phpize.\u00a0 make<\/span> is required for the program <span>make<\/span><\/p>\n<pre style=\"text-align: justify;\">\r\n<pre> # install php5-dev\r\n # install make<\/pre>\n<pre>\r\n<h2 class=\"editable\">Installation<\/h2>\r\n<\/pre>\n<pre style=\"text-align: justify;\">get the latest eaccelarator source code on http:\/\/eaccelerator.net\/<\/pre>\n<pre style=\"text-align: justify;\">\r\n<pre># wget http:\/\/bart.eaccelerator.net\/source\/0.9.5.3\/eaccelerator-0.9.5.3.tar.bz2\r\n# tar xvjf eaccelerator-0.9.5.3.tar.bz2\r\n# cd eaccelerator-0.9.5.3\r\n# phpize\r\n# .\/configure --enable-eaccelerator=shared\r\n# make\r\n# make install<\/pre>\n<pre>Installing shared extensions:     \/usr\/lib\/php5\/20060613+lfs\/<\/pre>\n<pre>Now  you need to edit <em>\/etc\/php5\/apache2\/php.ini<\/em> and add the following line\u00a0<\/pre>\n<pre>at the beginning of the file after the [PHP] tag:<\/pre>\n<pre>\r\n<pre>[PHP]\r\n\r\n; eAccelerator configuration\r\n; Note that eAccelerator may also be installed as a PHP extension or as a zend_extension\r\n; If you are using a thread safe build of PHP you must use\r\n; zend_extension_ts instead of zend_extension\r\n;extension                       = \"\/usr\/lib\/php5\/20060613+lfs\/eaccelerator.so\"\r\nzend_extension                  = \"\/usr\/lib\/php5\/20060613+lfs\/eaccelerator.so\"\r\neaccelerator.shm_size           = \"16\"\r\neaccelerator.cache_dir          = \"\/var\/cache\/eaccelerator\"\r\neaccelerator.enable             = \"1\"\r\neaccelerator.optimizer          = \"1\"\r\neaccelerator.check_mtime        = \"1\"\r\neaccelerator.debug              = \"0\"\r\neaccelerator.filter             = \"\"\r\neaccelerator.shm_max            = \"0\"\r\neaccelerator.shm_ttl            = \"0\"\r\neaccelerator.shm_prune_period   = \"0\"\r\neaccelerator.shm_only           = \"0\"\r\neaccelerator.compress           = \"1\"\r\neaccelerator.compress_level     = \"9\"\r\neaccelerator.allowed_admin_path = \"\/var\/www\/control.php\"<\/pre>\n<div id=\"section_3\"><span>NOTE:<\/span> If you install Zend Optimizer and\/or ionCube Loader you should be sure that\u00a0<\/div>\n<div id=\"section_3\">ionCube loads before Zend Optimizer and <span class=\"highlight\">eAccelerator<\/span> installs before both for proper operation\u00a0<\/div>\n<div id=\"section_3\">of all three extensions.\u00a0\u00a0\u00a0\u00a0<\/p>\n<pre>[PHP]\r\n\r\n; eAccelerator configuration\r\n; Note that eAccelerator may also be installed as a PHP extension or as a zend_extension\r\n; If you are using a thread safe build of PHP you must use\r\n; zend_extension_ts instead of zend_extension\r\n;extension                       = \"\/usr\/lib\/php5\/20060613+lfs\/eaccelerator.so\"\r\nzend_extension                  = \"\/usr\/lib\/php5\/20060613+lfs\/eaccelerator.so\"\r\neaccelerator.shm_size           = \"16\"\r\neaccelerator.cache_dir          = \"\/var\/cache\/eaccelerator\"\r\neaccelerator.enable             = \"1\"\r\neaccelerator.optimizer          = \"1\"\r\neaccelerator.check_mtime        = \"1\"\r\neaccelerator.debug              = \"0\"\r\neaccelerator.filter             = \"\"\r\neaccelerator.shm_max            = \"0\"\r\neaccelerator.shm_ttl            = \"0\"\r\neaccelerator.shm_prune_period   = \"0\"\r\neaccelerator.shm_only           = \"0\"\r\neaccelerator.compress           = \"1\"\r\neaccelerator.compress_level     = \"9\"\r\n<pre>eaccelerator.allowed_admin_path = \"\/var\/www\/control.php\"<\/pre>\n<p>; ionCube Loader configuration zend_extension=\/usr\/local\/lib\/ioncube\/ioncube_loader_lin_5.2.so  ; Zend Optimizer configuration zend_extension=\/usr\/local\/lib\/Zend\/ZendOptimizer.so zend_optimizer.optimization_level=15<br \/>\nCreate and change permissions of the <span class=\"highlight\">eAccelerator<\/span> cache directory<\/p>\n<pre># mkdir -p \/var\/cache\/eaccelerator\r\n# chmod 0777 \/var\/cache\/eaccelerator<\/pre>\n<pre>\r\n<h4>Control panel<\/h4>\r\neAccelerator provides a \"control panel\" of sorts that is useful to\r\nsee what pages are being cached and usage of shared memory. To install\r\nthe control panel, first copy file control.php into the web server\r\ndocument root:\r\n<pre># cd \/root\/eaccelerator-0.9.5.3<\/pre>\n<pre><code># cp <\/code><code>control.php \/var\/www\/eaccelerator\/<\/code><\/pre>\n<p>Edit control.php to change the <code>$user<\/code> and <code>$pw settings<\/code> to a user name and password of your choosing.\u00a0<\/p>\n<p>Don\u2019t leave them as the default or attackers will be able to disrupt the cache.<\/p>\n<p>View the control panel at <a href=\"http:\/\/your-server-url\/control.php\">http:\/\/your-server-url\/control.php<\/a><\/p>\n<p>Note: if you rename or move control.php you must update the <code>eaccelerator.allowed_admin_path<\/code> setting in php.ini\n<\/div>\n<div id=\"section_4\">\n<h2 class=\"editable\">Restart Apache<\/h2>\n<pre># \/etc\/init.d\/apache2 restart<\/pre>\n<\/div>\n<p>But strange thing happen to my server, when i try to checked the php version.\u00a0<\/p>\n<p>eaccelerator hasn't installed yet<\/p>\n<pre style=\"text-align: justify;\"># php -v\r\nPHP 5.2.4-2ubuntu5.5 with Suhosin-Patch 0.9.6.2 (cli) (built: Feb 11 2009 20:09:52)\r\nCopyright (c) 1997-2007 The PHP Group\r\nZend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies<\/pre>\n<pre style=\"text-align: justify;\">okay i try to locate php.ini configuration that being use by php<\/pre>\n<pre style=\"text-align: justify;\"># php --ini\r\nConfiguration File (php.ini) Path: \/etc\/php5\/cli\r\nLoaded Configuration File:         \/etc\/php5\/cli\/php.ini\r\nScan for additional .ini files in: \/etc\/php5\/cli\/conf.d\r\nAdditional .ini files parsed:      \/etc\/php5\/cli\/conf.d\/mysql.ini,\r\n\/etc\/php5\/cli\/conf.d\/mysqli.ini,\r\n\/etc\/php5\/cli\/conf.d\/pdo.ini,\r\n\/etc\/php5\/cli\/conf.d\/pdo_mysql.ini,\r\n\/etc\/php5\/cli\/conf.d\/snmp.ini<\/pre>\n<div style=\"text-align: justify;\"><span>Okay as you can see it is pointing to\u00a0\/etc\/php5\/cli , okay i edit the\u00a0\/etc\/php5\/cli and add this<\/span><\/div>\n<div style=\"text-align: justify;\"><span>\u00a0\u00a0\u00a0\u00a0<\/p>\n<pre>[PHP]\r\n\r\n; eAccelerator configuration\r\n; Note that eAccelerator may also be installed as a PHP extension or as a zend_extension\r\n; If you are using a thread safe build of PHP you must use\r\n; zend_extension_ts instead of zend_extension\r\n;extension                       = \"\/usr\/lib\/php5\/20060613+lfs\/eaccelerator.so\"\r\nzend_extension                  = \"\/usr\/lib\/php5\/20060613+lfs\/eaccelerator.so\"\r\neaccelerator.shm_size           = \"16\"\r\neaccelerator.cache_dir          = \"\/var\/cache\/eaccelerator\"\r\neaccelerator.enable             = \"1\"\r\neaccelerator.optimizer          = \"1\"\r\neaccelerator.check_mtime        = \"1\"\r\neaccelerator.debug              = \"0\"\r\neaccelerator.filter             = \"\"\r\neaccelerator.shm_max            = \"0\"\r\neaccelerator.shm_ttl            = \"0\"\r\neaccelerator.shm_prune_period   = \"0\"\r\neaccelerator.shm_only           = \"0\"\r\neaccelerator.compress           = \"1\"\r\neaccelerator.compress_level     = \"9\"\r\neaccelerator.allowed_admin_path = \"\/var\/www\/control.php\"<\/pre>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p><\/span><\/div>\n<pre style=\"text-align: justify;\">then i restart the apache<\/pre>\n<pre style=\"text-align: justify;\">\r\n<pre># \/etc\/init.d\/apache2 restart<\/pre>\n<pre>checked the php version<\/pre>\n<pre># php -v\r\nPHP 5.2.4-2ubuntu5.5 with Suhosin-Patch 0.9.6.2 (cli) (built: Feb 11 2009 20:09:52)\r\nCopyright (c) 1997-2007 The PHP Group\r\nZend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies\r\n    with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator<\/pre>\n<div>okay it is changes then i try to checked the phpinfo on my web but eAccelerator hasn't\u00a0<\/div>\n<div>been added yet<\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-247\" title=\"eaccel11\" src=\"http:\/\/adityo.blog.binusian.org\/files\/2009\/04\/eaccel11.png\" alt=\"eaccel11\" width=\"600\" height=\"749\" srcset=\"https:\/\/adityo.blog.binusian.org\/files\/2009\/04\/eaccel11.png 600w, https:\/\/adityo.blog.binusian.org\/files\/2009\/04\/eaccel11-240x300.png 240w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/div>\n<pre>Hmm, strange it is because the phpmyadmin are using Loaded\u00a0<\/pre>\n<pre>Configuration File = \/etc\/php5\/apache2\/php.ini.<\/pre>\n<pre>I try to create soft symlink on \/etc\/php5\/, i changes the \/etc\/php5\/apache\u00a0<\/pre>\n<pre>to different name let say\u00a0<\/pre>\n<pre>\/etc\/php5\/apache_old,<\/pre>\n<pre>then i create sysmlink for \/etc\/php5\/cli<\/pre>\n<pre># ln -s \/etc\/php5\/cli apache<\/pre>\n<pre># ls -al<\/pre>\n<p>total 20\u00a0<\/p>\n<p>drwxr-xr-x  5 root root  4096 2009-04-01 17:55 .\u00a0<\/p>\n<p>drwxr-xr-x 21 root root  4096 2008-12-22 12:24 ..\u00a0<\/p>\n<p>lrwxrwxrwx  1 root root    13 2009-04-01 17:55 apache -&gt; \/etc\/php5\/cli\u00a0<\/p>\n<p>drwxr-xr-x   2 root root 4096 2009-04-01 15:32 apache_old\u00a0<\/p>\n<p>drwxr-xr-x   2 root root 4096 2009-04-01 15:35 cli\u00a0<\/p>\n<p>drwxr-xr-x   2 root root 4096 2009-03-12 15:27 conf.d<\/p>\n<pre>Then i restart the apache<\/pre>\n<pre>\r\n<pre># \/etc\/init.d\/apache2 restart<\/pre>\n<pre>checked the phpinfo files on the web, it is changes<\/pre>\n<pre><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-251\" title=\"eaccel2\" src=\"http:\/\/adityo.blog.binusian.org\/files\/2009\/04\/eaccel2.png\" alt=\"eaccel2\" width=\"600\" height=\"750\" srcset=\"https:\/\/adityo.blog.binusian.org\/files\/2009\/04\/eaccel2.png 600w, https:\/\/adityo.blog.binusian.org\/files\/2009\/04\/eaccel2-240x300.png 240w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/pre>\n<div>Okay is it is strange, i am curious what happen if i delete yhe symlink and changes back\u00a0<\/div>\n<div>the\u00a0\/etc\/php5\/apache_old to \/etc\/php5\/apache<\/div>\n<pre># rm \/etc\/php5\/apache\r\n# mv \/etc\/php5\/apache_old \/etc\/php5\/apache<\/pre>\n<pre># ls -al\r\ntotal 20\r\ndrwxr-xr-x   5 root root 4096 2009-04-01 16:42 .\r\ndrwxr-xr-x 102 root root 4096 2009-04-01 17:46 ..\r\ndrwxr-xr-x   2 root root 4096 2009-04-01 15:47 apache2\r\ndrwxr-xr-x   2 root root 4096 2009-04-01 15:35 cli\r\ndrwxr-xr-x   2 root root 4096 2009-03-12 15:27 conf.d<\/pre>\n<pre>Then i restart the apache<\/pre>\n<pre>\r\n<pre># \/etc\/init.d\/apache2 restart<\/pre>\n<pre> Both phpinfo and php -v show the eAccelerator<\/pre>\n<pre># php -v\r\nPHP 5.2.4-2ubuntu5.5 with Suhosin-Patch 0.9.6.2 (cli) (built: Feb 11 2009 20:09:52)\r\nCopyright (c) 1997-2007 The PHP Group\r\nZend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies\r\n    with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator<\/pre>\n<div>Okay i don't know it is because of cache or something but it is installed in the end \ud83d\ude42<\/div>\n<div style=\"text-align: justify;\"><span><br \/>\n<\/span><\/div>\n","protected":false},"excerpt":{"rendered":"<p>What is eAccelerator ? is a free open-source PHP accelerator, optimizer, and dynamic content cache. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases [&hellip;]<\/p>\n","protected":false},"author":386,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[891],"tags":[892],"class_list":["post-243","post","type-post","status-publish","format-standard","hentry","category-php","tag-eacclerator"],"_links":{"self":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/243","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/users\/386"}],"replies":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=243"}],"version-history":[{"count":16,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/243\/revisions"}],"predecessor-version":[{"id":253,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/243\/revisions\/253"}],"wp:attachment":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=243"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=243"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}