Apache Lounge


About Forum Index Downloads Search Register Log in  RSS Apache Lounge  

Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.



A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.

Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: PHP settings in apache2 config file completely ignored

Joined: 23 Sep 2020
Posts: 1

PostPosted: Wed 23 Sep '20 13:48    Post subject: PHP settings in apache2 config file completely ignored Reply with quote

Hi all,

On a fresh Debian 9 install, I installed PHP 7.2 and Apache2.

php has been installed from the Sury repo with these extensions:

php7.2-mysql php7.2-dom
php7.2-simplexml php7.2-ssh2 php7.2-xml
php7.2-xmlreader php7.2-curl php7.2-exif php7.2-gd  php7.2-iconv php7.2-imagick
php7.2-mbstring php7.2-posix php7.2-sockets php7.2-tokenizer
php7.2-soap php7.2-intl php7.2-mbstring

everything seem to be working fine I even managed to
install wordpress on the server, however if I try to
ovrride the php.ini configs in the virtualhost config for Apache2 they are not overridden
no matter where I put them in the file, I tried in and outside the
Directory tag and I tried php_admin_value, php_value,
php_flag and php_admin_flag. None of them is working
and I'm not sure what to do to solve this.
I need to override the open_basedir settings because
I need to host multiple websites on the same server, so it's very important for its security.

Loaded modules from php info:

core mod_so mod_watchdog
http_core mod_log_config mod
logio mod_version
mod_unixd mod_access_compat
mod_alias mod_auth_basic
mod_authn_core mod_authn_file
mod_authz_core mod_authz_host
mod_authz_user mod_autoindex
mod_deflate mod_dir
mod_env mod_filter mod_headers
mod_mime prefork mod_negotiation
mod_php7 mod_reqtimeout mod_rewrite
mod_setenvif mod_status

Loaded Configuration File

Additional .ini files parsed:



 Server Root   /etc/apache2

Strangely enough the php info page returns DOCUMENT_ROOT and CONTEXT_DOCUMENT_ROOT as

even though my virtual host's root is

ls /etc/apache2/sites-enabled/
000-default.conf <mydomain>.conf


ls /etc/apache2/conf-enabled/
charset.conf other-vhosts-access-log.conf
localized-error-pages.conf security.conf


ls /etc/apache2/mods-enabled/
access_compat.load  autoindex.conf  mime.conf         reqtimeout.load
alias.conf autoindex.load  mime.load         rewrite.load
deflate.conf mpm_prefork.conf
deflate.load mpm_prefork.load
authn_core.load dir.conf
negotiation.conf status.conf
authn_file.load dir.load
negotiation.load status.load
env.load php7.2.conf
authz_host.load filter.load
authz_user.load headers.load    reqtimeout.conf



 <VirtualHost *:80>
            # The ServerName directive sets the request scheme, hostname and port t$
            # the server uses to identify itself. This is used when creating
            # redirection URLs. In the context of virtual hosts, the ServerName
            # specifies what hostname must appear in the request's Host: header to
            # match this virtual host. For the default virtual host (this file) this
            # value is not decisive as it is used as a last resort host regardless.
            # However, you must set it for any further virtual host explicitly.
            #ServerName www.example.com
            ServerAdmin webmaster@localhost
            ServerName <mydomain>
            DocumentRoot /var/www/html/<mydomain>
            DirectoryIndex index.html
            # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
            # error, crit, alert, emerg.
            # It is also possible to configure the loglevel for particular
            # modules, e.g.
    #LogLevel info ssl:warn
            ErrorLog ${APACHE_LOG_DIR}/<mydomain>_error.log
            CustomLog ${APACHE_LOG_DIR}/<mydomain>_access.log combined
            # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
            # include a line for only one particular virtual host. For example the
            # following line enables the CGI configuration for this host only
            # after it has been globally disabled with "a2disconf".
            #Include conf-available/serve-cgi-bin.conf
            <Directory /var/www/html/<mydomain>>
                    AllowOverride All
                    Require host <mydomain>
                    #php_admin_flag engine Off
                    php_admin_value open_basedir /var/www/html/<mydomain>
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Admin note;
See Forum rules, moved the complete php.ini to https://apaste.info/vAYE

Back to top

Reply to topic   Topic: PHP settings in apache2 config file completely ignored View previous topic :: View next topic
Post new topic   Forum Index -> Other Software