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

Hardware Secrets

Uncomplicating the complicated

  • Case
  • Cooling
  • Memory
  • Mobile
    • Laptops
    • Smartphones
    • Tablets
  • Motherboard
  • Networking
  • Other
    • Audio
    • Cameras
    • Consumer Electronics
    • Desktops
    • Museum
    • Software
    • Tradeshows & Events
  • Peripherals
    • Headset
    • Keyboard
    • Mouse
    • Printers
  • Power
  • Storage
  • Video

How to Build a Web Server with PHP 5 and MySQL 5 Support

Building a PHP 5 web server with MySQL 5 support isn’t as easy as it seems. PHP 5 doesn’t come with embedded support for MySQL, making it tricky to compile PHP 5. Read this step-by-step tutorial and avoid all the pitfalls you may face.

Home » How to Build a Web Server with PHP 5 and MySQL 5 Support

Introduction

Contents

  • 1. Introduction
  • 2. Configuring and Installing Apache 2
  • 3. Configuring and Installing MySQL 5
  • 4. Configuring and Installing PHP 5
  • 5. Configuring and Installing Xcache

Building a PHP 5 web server with MySQL 5 support isn’t as easy as it seems. We know this by heart: we spend literally a whole day last week trying to do this. The main problem is that PHP 5 doesn’t come with embedded support for MySQL and MySQL 5 does not provide a separated stand-alone client module ready for downloading and installing. In this step-by-step tutorial we will show you how to compile and install Apache 2, PHP 5 with MySQL 5 support and PHP optimization and caching system (Xcache) on Linux, so you will be able to build your own web server in a matter of minutes – and not hours like happened to us.

We got several error messages along the way, and we are going to publish the most common ones, so if you get the same messages you will know what to do.

The most important thing is that you need to upgrade your Linux version to its latest version, or at least check if libstdc++.so.6 is installed. It should be at /usr/lib/ directory (you can also try locate libstdc++.so.6 command). If you cannot find this file, you will get the following error message along the way:

error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

This error happens because your system has an old version of C++ library, probably libstdc++.so.5. The solution is to update the C++ library. However, since almost everything on Linux depends on C++, you will have to upgrade a lot of stuff as well. On Debian, the Linux flavor we were using, it was easier to simply upgrade de whole system with the following commands:

apt-get update
apt-get dist-upgrade

This will upgrade not only the C++ library but also update your Debian to its latest version. We recommend you performing these commands before starting the installation and configuration process.

Another trick for Debian users is to edit /etc/apt/sources.list and check from which server Debian will download files using apt commands like apt-get. By default you will see https://ftp.debian.org there, but this server is usually overloaded. You can comment the lines that point to debian.org and add new lines pointing to a faster mirror, for example:

deb https://ftp.uwsg.indiana.edu/linux/debian stable main
deb-src https://ftp.uwsg.indiana.edu/linux/debian stable main

A full list of mirrors is available here: https://www.debian.org/mirror/list. Scroll down and prefer using a secondary mirror, because they are usually less loaded, thus making all your installing and upgrading process a lot easier – especially for upgrading the whole operating system like we recommended.

After these preliminary explanations, let’s go to our step-by-step tutorial. Please notice that the following steps must be done on the same order we wrote: you cannot try to compile and install PHP 5 before MySQL 5 – it won’t work.

Continue: Configuring and Installing Apache 2

Networking Tutorials

Primary Sidebar

As a participant in the Amazon Services LLC Associates Program, this site may earn from qualifying purchases. We may also earn commissions on purchases from other retail websites.

audio connectors on a motherboard (right) and ethernet + usb connectors (left)

How On-Board Audio Works

Learn how the sound card that comes embedded on your motherboard works.

How To Connect Your PC to Your Home Stereo or Home Theater

Learn how to hook your PC to your stereo or receiver in order to enhance you audio experience while playing games, watching videos, listening to music or even editing audio.

motherboard

Which is the best motherboard for Coffee Lake CPUs?

We compared seven different motherboards for Intel eighth-gen (Coffee Lake) CPUs, to help you to choose which one is the best for you. Check it out!

RAM Install

Does more RAM make difference in gaming performance?

Does installing more RAM in your computer improves gaming performance? We tested some recent games with 4 GiB, 8 GiB, and 16 GiB to find out. Check it out!

How to Refill Epson Cartridges

Learn how to reset the Epson cartridge chip, allowing you to refill the cartridge.

Footer

For Performance

  • PCI Express 3.0 vs. 2.0: Is There a Gaming Performance Gain?
  • Does dual-channel memory make difference on integrated video performance?
  • Overclocking Pros and Cons
  • All Core i7 Models
  • Understanding RAM Timings

Everything you need to know

  • Everything You Need to Know About the Dual-, Triple-, and Quad-Channel Memory Architectures
  • Everything You Need to Know About the SPDIF Connection
  • Everything You Need to Know About the Intel Virtualization Technology
  • Everything You Need to Know About the CPU C-States Power Saving Modes

Follow Us

Follow us on Facebook Follow us on Twitter Follow us on Instagram

Copyright © 2022 · All rights reserved - Hardwaresecrets.com
About Us · Privacy Policy · Contact