Sign inSign up

zuraj/php-84-apache

By zuraj

Updated 9 months ago

PHP 8.4 image to host a Laravel (12.x) application

Image
0

10K+

zuraj/php-84-apache repository overview

Still working on this, so information might be incomplete...

About

This image is intended to host a Laravel (12.x) application on Apache httpd and PHP 8.4 in a container.

Especially to run in the Container Manager of a Synology Diskstation. As for today you can only install PHP 8.2 from the Package Center on a Synology, but Laravel Installer requires at least PHP 8.3 (I think...)

It basically contains the php:8.4-apache official image. I have just changed DocumentRoot (from originally /var/www/html) to /var/www/html/public and activated mod_rewrite to make Laravel work.

This image also contains latest composer/composer version.

How-to

  • On your local machine
    • Create a directory structure e.g. /local/src/public
    • Copy my-site.conf to /local directory (see example below)
  • Download this image
  • Run this image with...
    • Port = e.g. 8484
    • Volumes
      • Host path = /local/src
      • Container path = /var/www/html
  • Now create/copy your index.php in directory /local/src/public (see example below)
  • Call http://localhost:8484/
    • ...you should now see information about your installed PHP version

When this works you can start deploying/developing your Laraval application in /local/src folder...

Sample files

my-site.conf

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/public

    <Directory /var/www/html/public>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

index.php

<?php

echo phpinfo();

Tag summary

Content type

Image

Digest

sha256:0b7f2708d

Size

172.4 MB

Last updated

9 months ago

docker pull zuraj/php-84-apache