• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

KaliTut

Kali Linux tutorial and Linux Tips

  • Home
  • Raspberry Pi
  • Privacy Policy
  • About us
  • Affiliate disclaimer

Speed ​​up web server with PHP5 on Raspberry Pi (lighttpd)

November 24, 2017 by Kalitut

Speed up web server with APC cache for PHP on Raspberry Pi (lighttpd)

Speed ​​up web server

Raspberry Pi is also suitable for operation as a web server. Unfortunately, he is a bit weak on his chest because of his hardware. That is, the web server gets you up and running fast enough. It looks different if the web server (for example lighttpd) works with PHP5. Then the execution speed depends on the model a bit sluggish or even extremely slow.

This is where caching helps. For example with APC. APC stands for Alternative PHP Cache. This is an extension for PHP that can accelerate the PHP code by caching and optimizing already interpreted versions of the scripts. When called again, the interpreted code comes from the cache, not the interpreter.
Thanks to the PHP cache APC gets Raspberry Pi together with lighttpd and PHP to an acceptable working speed.
Task

  • Extend the web server lighttpd with the PHP cache APC.

Solution
First, install the PHP cache APC to:

sudo apt-get update
sudo apt-get install php-apc

Then some settings have to be made on the APC cache. To do this, open the APC configuration file:

sudo nano /etc/php5/mods-available/apcu.ini

Here you make the following changes.

extension = apcu.so
apc.enabled = 1
apc.file_update_protection = 2
apc.optimization = 0
apc.shm_size = 32M
apc.include_once_override = 0
apc.shm_segments = 1
apc.gc_ttl = 7200
apc.ttl = 7200
apc.num_files_hint = 1024
apc.enable_cli = 0

Note: A cache size of 32MB is certainly useful (“apc.shm_size = 32M”). However, there are applications that need more. So if APC does not seem to bring any improvement you can also experiment with values of 64MB and 128MB. Keep in mind that this value is missing for other applications in memory.

To apply the changes, reload the configuration of the web server.

sudo service lighttpd force-reload
Post Views: 37

Filed Under: Raspberry Pi

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Follow us

  • Facebook
  • Twitter
  • YouTube

Categories

  • algorithm
  • Android Ai coding
  • Android pentesting tools
  • Arduino
  • Artificial Intelligence
  • Books
  • ChatGPT Prompt
  • Darknet
  • database
  • General
  • Github Tools
  • Hacking
  • Kali Linux
  • Linux
  • Linux Commands
  • Network Administrator
  • Penetration Testing
  • Penetration Testing Tools
  • PowerShell
  • Raspberry Pi
  • resources
  • Review
  • Termux
  • Tutorials
  • Ubuntu
  • Uncategorized
  • Video Tutorials
  • vmware
  • WiFi Adapter
  • WiFi Pentesting
  • Wireless Router
  • Wireshark

Recent Posts

  • Transforming Photos with ChatGPT Prompt : A Cinematic Double Exposure in a Post-Apocalyptic World
  • Stryker Android App: Your Mobile Pentesting Powerhouse
  • Alfa awus036ach review
  • Alfa AWUS1900 for Wireless Penetration Testing
  • How to Run DeepSeek AI Locally on Kali Linux – Step-by-Step Guide

Footer

Kalitut

Kalitut.com goal is to share the knowledge for free, help you find the best tools on the web and provides tutorials

Find us on social media

  • Facebook
  • Pinterest
  • Reddit
  • Twitter
  • YouTube

Copyright © 2025

  • Home
  • About us
  • Privacy Policy
  • Affiliate disclaimer