sudo apt update
sudo apt install -y build-essential autoconf bison re2c libxml2-dev \
libsqlite3-dev libssl-dev libcurl4-openssl-dev libjpeg-dev libpng-dev \
libwebp-dev libxpm-dev libzip-dev libonig-dev libreadline-dev \
libtidy-dev libxslt1-dev libffi-dev pkg-config git perl apache2-dev
wget https://www.php.net/distributions/php-8.3.21.tar.gz
7z x php-8.3.21.tar.gz
cd php-8.3.21
./configure --with-apxs2=/usr/bin/apxs \
--enable-mbstring --with-curl --with-openssl --enable-soap \
--enable-intl --with-zip --with-zlib --enable-bcmath --with-readline \
--with-xsl --with-tidy --enable-pcntl --enable-opcache --with-mysqli \
--with-pdo-mysql --enable-fpm --enable-zts --with-gd
make -j$(nproc)
make test
sudo make install
#Verifica que se haya creado el módulo
ls /usr/lib/apache2/modules/libphp*.so
#Carga el módulo en Apache
sudo nano /etc/apache2/mods-available/php.load
LoadModule php_module /usr/lib/apache2/modules/libphp.so
sudo cp /usr/local/bin/php /usr/bin/
php --version
sudo a2enmod php
a2query -m
echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php
sudo nano /etc/apache2/apache2.conf
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
DirectoryIndex index.php
sudo systemctl restart apache2
Last active
May 14, 2025 22:29
-
-
Save nullx5/b02dd9d7e019351dbdf81afe0beb3047 to your computer and use it in GitHub Desktop.
sudo make install
Installing PHP CLI binary: /usr/local/bin/
Installing PHP CLI man page: /usr/local/php/man/man1/
Installing PHP FPM binary: /usr/local/sbin/
Installing PHP FPM defconfig: /usr/local/etc/
Installing PHP FPM man page: /usr/local/php/man/man8/
Installing PHP FPM status page: /usr/local/php/php/fpm/
Installing phpdbg binary: /usr/local/bin/
Installing phpdbg man page: /usr/local/php/man/man1/
Installing PHP CGI binary: /usr/local/bin/
Installing PHP CGI man page: /usr/local/php/man/man1/
Installing build environment: /usr/local/lib/php/build/
Installing header files: /usr/local/include/php/
Installing helper programs: /usr/local/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/php/man/man1/
page: phpize.1
page: php-config.1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
❌ ¿QUÉ SIGNIFICA ESTE ERROR?
Apache está usando un MPM (Multi-Processing Module) de tipo threaded (probablemente event), pero tu PHP compilado no es threadsafe (es decir, no fue compilado con --enable-maintainer-zts).
mod_php no es compatible con MPM threaded si no está compilado con ZTS (Zend Thread Safety).
SOLUCION
Recompilar PHP con soporte ZTS (hilos seguros)
Recomendación moderna
En lugar de usar mod_php, se suele usar PHP-FPM (FastCGI), que es más rápido y no tiene este problema, y funciona bien con mpm_event.