Installation
System Requirements
-
PHP Version: 8.1.31 or higher
-
Memory: Minimum 512MB RAM
-
Disk Space: 100MB available space
-
Extensions: Required extensions listed below
Installation Methods
Docker Installation (Recommended)
dockerfile
FROM php:8.1.31-fpm-alpine
# Install system dependencies
RUN apk add --no-cache \
git \
curl \
libpng-dev \
oniguruma-dev \
libxml2-dev \
zip \
unzip
# Install PHP extensions
RUN docker-php-ext-install \
pdo_mysql \
mbstring \
exif \
pcntl \
bcmath \
gd \
opcache
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www/html
# Copy application files
COPY . .
# Install dependencies
RUN composer install --no-dev --optimize-autoloader
EXPOSE 9000
CMD ["php-fpm"]
Ubuntu/Debian Installation
bash
# Add PHP repository
sudo add-apt-repository ppa:ondrej/php
sudo apt update
# Install PHP 8.1
sudo apt install php8.1 php8.1-fpm php8.1-mysql php8.1-xml php8.1-gd php8.1-opcache php8.1-mbstring
# Install Composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
CentOS/RHEL Installation
bash
# Install EPEL and Remi repository
sudo yum install epel-release
sudo yum install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
# Enable PHP 8.1
sudo yum module enable php:remi-8.1
# Install PHP and extensions
sudo yum install php php-fpm php-mysql php-xml php-gd php-opcache php-mbstring
Required PHP Extensions
-
Core Extensions: json, mbstring, openssl, tokenizer, xml
-
Database: pdo, pdo_mysql, pdo_pgsql
-
Cache: redis, memcached
-
Image Processing: gd, imagick
-
Performance: opcache, apcu
Verification
bash
# Check PHP version
php -v
# Check installed extensions
php -m
# Check PHP configuration
php --ini