Heine

  • home
  • drupal
  • drupal core commits
  • about
Home

Alternative PHP cache on SUSE 9.3 Professional

Heine — Wed, 21/02/2007 - 04:17

Forget about # pecl install apc (Alternative PHP Cache on Debian Sarge). This is going to hurt.

All steps in this short overview were necessary on a Strato V-PowerServer. Depending on your installation, your mileage may vary.

# yast -i libidn-devel libapr1-devel libapr-util1-devel readline-devel libxml2-devel openssl-devel curl-devel apache2-devel
# yast -i autoconf automake make gcc binutils php4-devel mysql-devel

Some packages were necessary for the pecl install apc attempt and may not be necessary for the 'manual' apc installation.

Download and unpack the APC archive (in /tmp)

# wget http://pecl.php.net/get/APC
[fetched APC-3.0.12p2.tgz]
# tar -zxvf APC-3.0.12p2.tgz

Time to configure and compile

# cd APC-3.0.12p2
# phpize
# export CPPFLAGS="-I/usr/include/apache2 -DAPC_PHP4_STAT"
# ./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/bin/php-config --with-apxs=/usr/sbin/apxs2
# make
# make install
[apc.so will be placed in the extensions directory]

Open /etc/php.ini and add

extension=apc.so
apc.enabled=1
apc.shm_segments=1
apc.optimization=0
apc.shm_size=128
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=1

Restart Apache

# /etc/init.d/apache2 restart

Check whether all is well by placing info.php in your webroot (and visiting it).

  phpinfo();

You should see a new block apc with "APC Support - enabled"

You can get some statistics on APC, by moving the file apc.php to a web-accessible directory. Before you can use it, you need to open the file and set the following constants:

defaults('ADMIN_USERNAME', 'your_username');      // Admin Username
defaults('ADMIN_PASSWORD', 'your_password');      // Admin Password - CHANGE THIS TO ENABLE!!!

See also Cache or PHP-info is none of your business.

Average: 4.3 (3 votes)
  • Performance
  • PHP
  • V-PowerServer

Thanks

Ivan (not verified) — Wed, 28/11/2007 - 00:13

Works great also on suse 9.2!

  • reply

Post new comment

I reserve the right to edit any comment submitted to the site. If your comment contains flaming, advertisements, or simply too many spelling errors (leet speak), it may never appear.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <as>, <as3>, <csharp>, <diff>, <drupal5>, <drupal6>, <html>, <js>, <mysql>, <php>, <phpbrief>, <python>, <sql>, <plain>, <xml>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

Recent posts

  • Planet Drupal past and current
  • Help! - Cannot access a global variable.
  • Why is my module's update hook not listed on update.php's selection form?
  • How do I add a class to a link generated with l()
  • ZeroDayScan - Full path disclosure bug in Drupal 6.16 (0day)
more

Security reviews

  • Afraid custom code makes your site vulnerable?
  • You don't really trust that module you just downloaded from Drupal.org?

Sleep better after a security review.

Tags

Captcha CSRF Drupal embed Input Format modx OpenID Performance Planet Drupal rants Security Varnish
more tags
  • home
  • drupal
  • drupal core commits
  • about

Copyright © 2010 by Heine Deelstra. All rights reserved.