{"id":17989584,"url":"https://github.com/evilfreelancer/alpine-apache-php5","last_synced_at":"2025-03-25T23:30:51.113Z","repository":{"id":110656209,"uuid":"146553775","full_name":"EvilFreelancer/alpine-apache-php5","owner":"EvilFreelancer","description":"Docker image for LAP stack - Alpine + Apache2 + PHP5","archived":false,"fork":false,"pushed_at":"2019-08-03T10:41:43.000Z","size":8,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T22:09:54.045Z","etag":null,"topics":["alpine","apache2","docker","docker-image","php5"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EvilFreelancer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-29T06:14:33.000Z","updated_at":"2021-05-25T23:01:20.000Z","dependencies_parsed_at":"2023-03-30T04:34:02.448Z","dependency_job_id":null,"html_url":"https://github.com/EvilFreelancer/alpine-apache-php5","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Falpine-apache-php5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Falpine-apache-php5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Falpine-apache-php5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Falpine-apache-php5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvilFreelancer","download_url":"https://codeload.github.com/EvilFreelancer/alpine-apache-php5/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245561197,"owners_count":20635691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpine","apache2","docker","docker-image","php5"],"created_at":"2024-10-29T19:15:00.705Z","updated_at":"2025-03-25T23:30:51.088Z","avatar_url":"https://github.com/EvilFreelancer.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Alpine-based LAP Server with PHP extensions\n\nProvides a basic LAP stack using stable Alpine, Apache2 and PHP5 (version from stable repository of Alpine),\nloading in the various extensions along the way (see Dockerfile for full list).\n\nShould allow you to get going with a full LAP stack and support for DB via linked container (such as mysql)\nwith ease, allowing you to fine tune various aspects of the server and php via environment variables.\n\nIf you need PHP7 edition look at [this project](https://github.com/EvilFreelancer/alpine-apache-php7).\n\n\u003cdetails\u003e\n\u003csummary\u003e\n  \u003ci\u003eList of packages included in this image\u003c/i\u003e\n\u003c/summary\u003e\n\nbash, apache2, php5, php5-apache2, curl, ca-certificates, git\n\nphp5-phar, php5-json, php5-iconv, php5-openssl, php5-ftp, php5-xdebug,\nphp5-mcrypt, php5-soap, php5-gmp, php5-pdo_odbc, php5-dom, php5-pdo,\nphp5-zip, php5-mysqli, php5-sqlite3, php5-pdo_pgsql, php5-bcmath,\nphp5-gd, php5-odbc, php5-pdo_mysql, php5-pdo_sqlite, php5-gettext,\nphp5-xmlreader, php5-xmlrpc, php5-bz2, php5-pdo_dblib, php5-curl,\nphp5-ctype, php5-exif, php5-zlib\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\n  \u003ci\u003eList of all available environment variables\u003c/i\u003e\n\u003c/summary\u003e\n\nVarious env vars can be set at runtime via your docker command or docker-compose environment section:\n\n__APACHE_SERVER_NAME:__ Change server name to match your domain name in httpd.conf\n\n__PHP_SHORT_OPEN_TAG:__ Maps to php.ini 'short_open_tag'\n\n__PHP_OUTPUT_BUFFERING:__ Maps to php.ini 'output_buffering'\n\n__PHP_OPEN_BASEDIR:__ Maps to php.ini 'open_basedir'\n\n__PHP_MAX_EXECUTION_TIME:__ Maps to php.ini 'max_execution_time'\n\n__PHP_MAX_INPUT_TIME:__ Maps to php.ini 'max_input_time'\n\n__PHP_MAX_INPUT_VARS:__ Maps to php.ini 'max_input_vars'\n\n__PHP_MEMORY_LIMIT:__ Maps to php.ini 'memory_limit'\n\n__PHP_ERROR_REPORTING:__ Maps to php.ini 'error_reporting'\n\n__PHP_DISPLAY_ERRORS:__ Maps to php.ini 'display_errors'\n\n__PHP_DISPLAY_STARTUP_ERRORS:__ Maps to php.ini 'display_startup_errors'\n\n__PHP_LOG_ERRORS:__ Maps to php.ini 'log_errors'\n\n__PHP_LOG_ERRORS_MAX_LEN:__ Maps to php.ini 'log_errors_max_len'\n\n__PHP_IGNORE_REPEATED_ERRORS:__ Maps to php.ini 'ignore_repeated_errors'\n\n__PHP_REPORT_MEMLEAKS:__ Maps to php.ini 'report_memleaks'\n\n__PHP_HTML_ERRORS:__ Maps to php.ini 'html_errors'\n\n__PHP_ERROR_LOG:__ Maps to php.ini 'error_log'\n\n__PHP_POST_MAX_SIZE:__ Maps to php.ini 'post_max_size'\n\n__PHP_DEFAULT_MIMETYPE:__ Maps to php.ini 'default_mimetype'\n\n__PHP_DEFAULT_CHARSET:__ Maps to php.ini 'default_charset'\n\n__PHP_FILE_UPLOADS:__ Maps to php.ini 'file_uploads'\n\n__PHP_UPLOAD_TMP_DIR:__ Maps to php.ini 'upload_tmp_dir'\n\n__PHP_UPLOAD_MAX_FILESIZE:__ Maps to php.ini 'upload_max_filesize'\n\n__PHP_MAX_FILE_UPLOADS:__ Maps to php.ini 'max_file_uploads'\n\n__PHP_ALLOW_URL_FOPEN:__ Maps to php.ini 'allow_url_fopen'\n\n__PHP_ALLOW_URL_INCLUDE:__ Maps to php.ini 'allow_url_include'\n\n__PHP_DEFAULT_SOCKET_TIMEOUT:__ Maps to php.ini 'default_socket_timeout'\n\n__PHP_DATE_TIMEZONE:__ Maps to php.ini 'date.timezone'\n\n__PHP_PDO_MYSQL_CACHE_SIZE:__ Maps to php.ini 'pdo_mysql.cache_size'\n\n__PHP_PDO_MYSQL_DEFAULT_SOCKET:__ Maps to php.ini 'pdo_mysql.default_socket'\n\n__PHP_SESSION_SAVE_HANDLER:__ Maps to php.ini 'session.save_handler'\n\n__PHP_SESSION_SAVE_PATH:__ Maps to php.ini 'session.save_path'\n\n__PHP_SESSION_USE_STRICT_MODE:__ Maps to php.ini 'session.use_strict_mode'\n\n__PHP_SESSION_USE_COOKIES:__ Maps to php.ini 'session.use_cookies'\n\n__PHP_SESSION_COOKIE_SECURE:__ Maps to php.ini 'session.cookie_secure'\n\n__PHP_SESSION_NAME:__ Maps to php.ini 'session.name'\n\n__PHP_SESSION_COOKIE_LIFETIME:__ Maps to php.ini 'session.cookie_lifetime'\n\n__PHP_SESSION_COOKIE_PATH:__ Maps to php.ini 'session.cookie_path'\n\n__PHP_SESSION_COOKIE_DOMAIN:__ Maps to php.ini 'session.cookie_domain'\n\n__PHP_SESSION_COOKIE_HTTPONLY:__ Maps to php.ini 'session.cookie_httponly'\n\n__PHP_XDEBUG_ENABLED:__ Turns on xdebug (which is not for production really)\n\n\u003c/details\u003e\n\n## Usage\n\n### Docker Compose\n\nYou can create a `docker-compose.yml` file to keep things nice and simple:\n\n```yml\nversion: \"3\"\n\nservices:\n\n  mariadb:\n    restart: unless-stopped\n    image: mariadb:10\n    ports:\n    # Database port, will be mapped to localhost interface only\n    - 127.0.0.1:3308:3306\n    volumes:\n    # Path to folder of local filesystem with database files\n    - ./databases/mariadb:/var/lib/mysql\n    environment:\n    # Parameters which will be used in application\n    - MYSQL_ROOT_PASSWORD=ive_got_no_roots\n    - MYSQL_ROOT_HOST=%\n    - MYSQL_DATABASE=somedatabase\n    - MYSQL_USER=user\n    - MYSQL_PASSWORD=user_pass\n\n  application:\n    image: evilfreelancer/alpine-apache-php5\n    environment:\n    # Database parameters of app\n    - DB_HOST=mariadb\n    - DB_NAME=somedatabase\n    - DB_USER=user\n    - DB_PASS=user_pass\n    # Settings of php.ini\n    - PHP_SHORT_OPEN_TAG=On\n    - PHP_ERROR_REPORTING=E_ALL\n    - PHP_DISPLAY_ERRORS=On\n    - PHP_HTML_ERRORS=On\n    - PHP_XDEBUG_ENABLED=true\n    ports:\n    # Web-server HTTP port, will be mapped to all network interfaces\n    - 80:80\n    volumes:\n    # Folder in which will be \"public\" folder with index.php\n    # and other sources of application\n    - ./application:/app\n```\n\nWhere:\n\n* mariadb - Is a container with SQL database\n* application - Container based on `evilfreelancer/alpine-apache-php5` image with your application\n\nIn folder `./application` will be your application, it should have `./application/public` subfolder with `index.php` because this container is will use `/app/public` path as webroot of Apache.\n\nThen run command below, it will start composition of containers:\n\n```bash\ndocker-compose up -d\n```\n\n### Docker\n\nIf you would like to add some files into this container then you can create your own `Dockerfile` based on this image:\n\n```\nFROM evilfreelancer/alpine-apache-php5\n\nADD [\"./public\", \"/app/public\"]\nRUN composer update --working-dir=/app/public \\\n \u0026\u0026 chown -R apache:apache /app\n```\n\nProbably you want to install some packages via NPM by NodeJS:\n\n```\nFROM evilfreelancer/alpine-apache-php5\n\nADD [\".\", \"/app\"]\nWORKDIR /app\n\nRUN apk update \\\n \u0026\u0026 apk add --update --no-cache nodejs nodejs-npm \\\n \u0026\u0026 npm install \\\n \u0026\u0026 composer update \\\n \u0026\u0026 chown -R apache:apache /app\n```\n\nIf you want install some additional extension which not already installed:\n\n```\nFROM evilfreelancer/alpine-apache-php5\n\nADD [\".\", \"/app\"]\nWORKDIR /app\n\nRUN apk update \\\n \u0026\u0026 apk add --update --no-cache php5-amqp \\\n \u0026\u0026 composer update --working-dir=/app \\\n \u0026\u0026 chown -R apache:apache /app\n```\n\n## Where do I put my files?\n\nYou can place them in the /app folder, but your main `index.php` file must be in /app/public.\nThis allows you to have your src files and other outside the public directory.\n\n### Important folders and files inside container\n\n- Apache WebRoot - /app/public/\n- Apache Configs - /etc/apache2/\n- Apache Logs - /var/log/apache2/\n- Composer - /usr/local/bin/composer\n- PHP.ini - /etc/php5/php.ini\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilfreelancer%2Falpine-apache-php5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevilfreelancer%2Falpine-apache-php5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilfreelancer%2Falpine-apache-php5/lists"}