Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

php_value in .htaccess causes 500 Internal Server Error #1663

Closed
NeilANand opened this issue May 25, 2015 · 9 comments
Closed

php_value in .htaccess causes 500 Internal Server Error #1663

NeilANand opened this issue May 25, 2015 · 9 comments

Comments

@NeilANand
Copy link

Hello,

I'm trying to get a site running which sets some "php_value"s in the .htaccess file, however with this configuration I just get a server 500 error, if I remove those "php_value" bits it works fine.

Does anyone know what I've done incorrectly here?

Thanks,
Neil.

vagrantfile:
target: local
vm:
    box: puphpet/ubuntu1404-x64
    box_url: puphpet/ubuntu1404-x64
    hostname: braemaradjusting.puphpet
    memory: '512'
    cpus: '1'
    chosen_provider: virtualbox
    network:
        private_network: 192.168.56.101
        forwarded_port:
            vflnp_vw3bneqq43km:
                host: '6927'
                guest: '22'
    post_up_message: ''
    provider:
        virtualbox:
            modifyvm:
                natdnshostresolver1: on
            showgui: '0'
        vmware:
            numvcpus: 1
        parallels:
            cpus: 1
    provision:
        puppet:
            manifests_path: puphpet/puppet
            manifest_file: site.pp
            module_path: puphpet/puppet/modules
            options:
                - '--verbose'
                - '--hiera_config /vagrant/puphpet/puppet/hiera.yaml'
                - '--parser future'
    synced_folder:
        vflsf_edga3hrmmbgk:
            source: ../../braemaradjusting.com/htdocs
            target: /var/www
            sync_type: default
            smb:
                smb_host: ''
                smb_username: ''
                smb_password: ''
            rsync:
                args:
                    - '--verbose'
                    - '--archive'
                    - '-z'
                exclude:
                    - .vagrant/
                    - .git/
                auto: 'true'
            owner: www-data
            group: www-data
    usable_port_range:
        start: 10200
        stop: 10500
ssh:
    host: null
    port: null
    private_key_path: null
    username: vagrant
    guest_port: null
    keep_alive: true
    forward_agent: false
    forward_x11: false
    shell: 'bash -l'
vagrant:
    host: detect
server:
install: '1'
packages:
    - vim
users_groups:
install: '1'
groups: {  }
users: {  }
firewall:
install: '1'
rules: {  }
cron:
install: '1'
jobs: {  }
nginx:
install: '0'
settings:
    default_vhost: 1
    proxy_buffer_size: 128k
    proxy_buffers: '4 256k'
upstreams: {  }
vhosts:
    nxv_v410sbf5ab99:
        server_name: awesome.dev
        server_aliases:
            - www.awesome.dev
        www_root: /var/www/awesome
        listen_port: '80'
        index_files:
            - index.html
            - index.htm
            - index.php
        client_max_body_size: 1m
        ssl: '0'
        ssl_cert: ''
        ssl_key: ''
        ssl_port: '443'
        ssl_protocols: ''
        ssl_ciphers: ''
        rewrite_to_https: '1'
        spdy: '1'
        locations:
            nxvl_t1nj1v77wrxy:
                location: /
                autoindex: off
                try_files:
                    - $uri
                    - $uri/
                    - /index.php$is_args$args
                fastcgi: ''
                fastcgi_index: ''
                fastcgi_split_path: ''
            nxvl_03zjwd6p33u9:
                location: '~ \.php$'
                autoindex: off
                try_files:
                    - $uri
                    - $uri/
                    - /index.php$is_args$args
                fastcgi: '127.0.0.1:9000'
                fastcgi_index: index.php
                fastcgi_split_path: '^(.+\.php)(/.*)$'
                fast_cgi_params_extra:
                    - 'SCRIPT_FILENAME $request_filename'
                    - 'APP_ENV dev'
proxies: {  }
apache:
install: '1'
settings:
    user: www-data
    group: www-data
    default_vhost: true
    manage_user: false
    manage_group: false
    sendfile: 0
modules:
    - proxy_fcgi
    - rewrite
vhosts:
    av_gzy8ngb5ovoj:
        servername: braemaradjusting.dev
        serveraliases:
            - www.braemaradjusting.dev
        docroot: /var/www
        port: '80'
        setenv:
            - 'APP_ENV dev'
        custom_fragment: ''
        ssl: '0'
        ssl_cert: ''
        ssl_key: ''
        ssl_chain: ''
        ssl_certs_dir: ''
        ssl_protocol: ''
        ssl_cipher: ''
        directories:
            avd_sdr9h51u2h27:
                path: /var/www
                options:
                    - Indexes
                    - FollowSymlinks
                    - MultiViews
                allow_override:
                    - All
                require:
                    - 'all granted'
                custom_fragment: ''
                files_match:
                    avdfm_wjka91559l1t:
                        path: \.php$
                        sethandler: 'proxy:fcgi://127.0.0.1:9000'
                        custom_fragment: ''
                        provider: filesmatch
                provider: directory
php:
install: '1'
settings:
    version: '56'
modules:
    php:
        - cli
        - intl
        - mcrypt
    pear: {  }
    pecl:
        - pecl_http
ini:
    display_errors: On
    error_reporting: '-1'
    session.save_path: /var/lib/php/session
    date.timezone: UTC
fpm_ini:
    error_log: /var/log/php-fpm.log
fpm_pools:
    phpfp_b3pk1op7ijne:
        ini:
            prefix: www
            listen: '127.0.0.1:9000'
            security.limit_extensions: .php
            user: www-user
            group: www-data
composer: '1'
composer_home: ''
xdebug:
install: '1'
settings:
    xdebug.default_enable: '1'
    xdebug.remote_autostart: '0'
    xdebug.remote_connect_back: '1'
    xdebug.remote_enable: '1'
    xdebug.remote_handler: dbgp
    xdebug.remote_port: '9000'
blackfire:
install: '0'
settings:
    server_id: ''
    server_token: ''
    agent:
        http_proxy: ''
        https_proxy: ''
        log_file: stderr
        log_level: '1'
    php:
        agent_timeout: '0.25'
        log_file: ''
        log_level: '1'
xhprof:
install: '0'
wpcli:
install: '0'
version: v0.19.0
drush:
install: '0'
version: 6.3.0
ruby:
install: '1'
versions: {  }
python:
install: '1'
packages: {  }
versions: {  }
nodejs:
install: '0'
npm_packages: {  }
hhvm:
install: '0'
nightly: 0
composer: '1'
composer_home: ''
settings: {  }
server_ini:
    hhvm.server.host: 127.0.0.1
    hhvm.server.port: '9000'
    hhvm.log.use_log_file: '1'
    hhvm.log.file: /var/log/hhvm/error.log
php_ini:
    display_errors: On
    error_reporting: '-1'
    date.timezone: UTC
mysql:
install: '1'
settings:
    version: '5.6'
    root_password: password
    override_options: {  }
adminer: 0
users:
    mysqlnu_p3ykitotyt47:
        name: braemaradjusting
        password: password
databases:
    mysqlnd_alp16kjlj06r:
        name: braemar-adjusting
        sql: ''
grants:
    mysqlng_b9d0gdmdn6hy:
        user: braemaradjusting
        table: '*.*'
        privileges:
            - ALL
postgresql:
install: '0'
settings:
    global:
        encoding: UTF8
        version: '9.3'
    server:
        postgres_password: '123'
databases: {  }
users: {  }
grants: {  }
adminer: 0
mongodb:
install: '0'
settings:
    auth: 1
    bind_ip: 127.0.0.1
    port: '27017'
databases: {  }
redis:
install: '0'
settings:
    conf_port: '6379'
sqlite:
install: '0'
adminer: 0
databases: {  }
mailcatcher:
install: '1'
settings:
    smtp_ip: 0.0.0.0
    smtp_port: 1025
    http_ip: 0.0.0.0
    http_port: '1080'
    mailcatcher_path: /usr/local/rvm/wrappers/default
    from_email_method: inline
beanstalkd:
install: '0'
settings:
    listenaddress: 0.0.0.0
    listenport: '13000'
    maxjobsize: '65535'
    maxconnections: '1024'
    binlogdir: /var/lib/beanstalkd/binlog
    binlogfsync: null
    binlogsize: '10485760'
beanstalk_console: 0
binlogdir: /var/lib/beanstalkd/binlog
rabbitmq:
install: '0'
settings:
    port: '5672'
users: {  }
vhosts: {  }
plugins: {  }
elastic_search:
install: '0'
settings:
    version: 1.4.1
    java_install: true
solr:
install: '0'
settings:
    version: 4.10.2
    port: '8984'
@jtreminio
Copy link
Member

More than likely a PHP error. What's the error log say?

@NeilANand
Copy link
Author

Thanks for the quick response, where on the vagrant box should I look for the error log? I tried /var/log/apache2/error.log but the errors in there don't seem related to this unless I'm mistaken

[Mon May 25 18:20:44.064485 2015] [mpm_event:notice] [pid 19562:tid 140626622359424] AH00489: Apache/2.4.12 (Ubuntu) configured -- resuming normal operations
[Mon May 25 18:20:44.064537 2015] [core:notice] [pid 19562:tid 140626622359424] AH00094: Command line: '/usr/sbin/apache2'
[Mon May 25 18:22:27.146278 2015] [mpm_event:notice] [pid 19562:tid 140626622359424] AH00491: caught SIGTERM, shutting down
[Mon May 25 18:22:28.388192 2015] [mpm_worker:notice] [pid 2361:tid 140294957582208] AH00292: Apache/2.4.12 (Ubuntu) OpenSSL/1.0.1f configured -- resuming normal operations
[Mon May 25 18:22:28.388205 2015] [core:notice] [pid 2361:tid 140294957582208] AH00094: Command line: '/usr/sbin/apache2'
[Mon May 25 21:50:27.001069 2015] [mpm_worker:notice] [pid 2361:tid 140294957582208] AH00295: caught SIGTERM, shutting down
[Mon May 25 21:50:48.521709 2015] [mpm_worker:notice] [pid 1732:tid 140723493549952] AH00292: Apache/2.4.12 (Ubuntu) OpenSSL/1.0.1f configured -- resuming normal operations
[Mon May 25 21:50:48.522134 2015] [core:notice] [pid 1732:tid 140723493549952] AH00094: Command line: '/usr/sbin/apache2'
[Mon May 25 22:01:11.577553 2015] [mpm_worker:notice] [pid 1732:tid 140723493549952] AH00295: caught SIGTERM, shutting down
[Mon May 25 22:01:12.462106 2015] [mpm_worker:notice] [pid 9619:tid 139938080089984] AH00292: Apache/2.4.12 (Ubuntu) OpenSSL/1.0.1f configured -- resuming normal operations
[Mon May 25 22:01:12.462119 2015] [core:notice] [pid 9619:tid 139938080089984] AH00094: Command line: '/usr/sbin/apache2'
[Mon May 25 22:01:24.922978 2015] [mpm_worker:notice] [pid 9619:tid 139938080089984] AH00295: caught SIGTERM, shutting down
[Mon May 25 22:01:47.672429 2015] [mpm_worker:notice] [pid 1732:tid 140596969731968] AH00292: Apache/2.4.12 (Ubuntu) OpenSSL/1.0.1f configured -- resuming normal operations
[Mon May 25 22:01:47.672909 2015] [core:notice] [pid 1732:tid 140596969731968] AH00094: Command line: '/usr/sbin/apache2'
[Mon May 25 22:24:43.342543 2015] [mpm_worker:notice] [pid 1732:tid 140596969731968] AH00295: caught SIGTERM, shutting down
[Mon May 25 22:31:50.351824 2015] [mpm_worker:notice] [pid 9519:tid 140363119826816] AH00292: Apache/2.4.12 (Ubuntu) OpenSSL/1.0.1f configured -- resuming normal operations
[Mon May 25 22:31:50.353593 2015] [core:notice] [pid 9519:tid 140363119826816] AH00094: Command line: '/usr/sbin/apache2'
[Mon May 25 22:33:46.643661 2015] [mpm_worker:notice] [pid 9519:tid 140363119826816] AH00295: caught SIGTERM, shutting down
[Mon May 25 22:34:08.710622 2015] [mpm_worker:notice] [pid 1732:tid 139905765926784] AH00292: Apache/2.4.12 (Ubuntu) OpenSSL/1.0.1f configured -- resuming normal operations
[Mon May 25 22:34:08.711257 2015] [core:notice] [pid 1732:tid 139905765926784] AH00094: Command line: '/usr/sbin/apache2'
[Mon May 25 22:40:37.017768 2015] [mpm_worker:notice] [pid 1732:tid 139905765926784] AH00295: caught SIGTERM, shutting down
[Mon May 25 22:40:38.249462 2015] [mpm_worker:notice] [pid 9634:tid 140617464461184] AH00292: Apache/2.4.12 (Ubuntu) OpenSSL/1.0.1f configured -- resuming normal operations
[Mon May 25 22:40:38.249474 2015] [core:notice] [pid 9634:tid 140617464461184] AH00094: Command line: '/usr/sbin/apache2'
[Mon May 25 22:41:33.424659 2015] [mpm_worker:notice] [pid 9634:tid 140617464461184] AH00295: caught SIGTERM, shutting down
[Mon May 25 22:41:55.052678 2015] [mpm_worker:notice] [pid 1731:tid 140550668932992] AH00292: Apache/2.4.12 (Ubuntu) OpenSSL/1.0.1f configured -- resuming normal operations
[Mon May 25 22:41:55.053942 2015] [core:notice] [pid 1731:tid 140550668932992] AH00094: Command line: '/usr/sbin/apache2'
[Mon May 25 22:49:15.853935 2015] [mpm_worker:notice] [pid 1731:tid 140550668932992] AH00295: caught SIGTERM, shutting down
[Mon May 25 22:49:16.763056 2015] [mpm_worker:notice] [pid 9612:tid 139782134495104] AH00292: Apache/2.4.12 (Ubuntu) OpenSSL/1.0.1f configured -- resuming normal operations
[Mon May 25 22:49:16.763072 2015] [core:notice] [pid 9612:tid 139782134495104] AH00094: Command line: '/usr/sbin/apache2'
[Mon May 25 22:58:44.972269 2015] [mpm_worker:notice] [pid 9612:tid 139782134495104] AH00295: caught SIGTERM, shutting down
[Mon May 25 23:09:11.221921 2015] [mpm_worker:notice] [pid 2396:tid 140709399705472] AH00292: Apache/2.4.12 (Ubuntu) OpenSSL/1.0.1f configured -- resuming normal operations
[Mon May 25 23:09:11.222976 2015] [core:notice] [pid 2396:tid 140709399705472] AH00094: Command line: '/usr/sbin/apache2'
[Mon May 25 23:11:58.560525 2015] [mpm_worker:notice] [pid 2396:tid 140709399705472] AH00295: caught SIGTERM, shutting down
[Mon May 25 23:12:28.477518 2015] [mpm_worker:notice] [pid 2170:tid 139747895052160] AH00292: Apache/2.4.12 (Ubuntu) OpenSSL/1.0.1f configured -- resuming normal operations
[Mon May 25 23:12:28.478317 2015] [core:notice] [pid 2170:tid 139747895052160] AH00094: Command line: '/usr/sbin/apache2'

@jtreminio
Copy link
Member

Puphpet uses php-fpm which has its own separate error log.

/var/log/php-fpm.log or /var/log/php5-fpm.log

@NeilANand
Copy link
Author

I've checked both of those but they are empty, so I'm guessing it's not a PHP issue?

@thiagotalma
Copy link
Contributor

Not everything is a Puphpet problem.

Always remember that the Puphpet is just a compilation of third party modules. Most often the problem is the configuration of these modules.

https://github.com/puppetlabs/puppetlabs-apache#allow_override
http://httpd.apache.org/docs/current/mod/core.html#allowoverride

@NeilANand
Copy link
Author

Hello,

I've done some looking around in the Apache error logs & researching online and it appears the problem is that because PHP is running as FastCGI, as opposed to an Apache module, and php_value isn't allowed in the .htaccess file when PHP is running as CGI.

I've not really found a solution to this though, other than loading it as an Apache module I don't think there is. Would anyone have any ideas on how have Apache ignore php_value & other unknown values in the htaccess file? AllowOverride does have a Nonfatle option but that seems to cause other problems with statements in .htaccess files.

@stiig
Copy link
Contributor

stiig commented May 28, 2015

#1663 (comment) Ignore php value in .htaccess

<IfModule mod_php5.c>
php_value some_option
</IfModule>

@NeilANand
Copy link
Author

@stiig Sorry for taking so long to get back to you but that looks like just what I need.

@tomasdev
Copy link

tomasdev commented Sep 8, 2016

Yes, just make sure you're using <IfModule mod_php5.c> and don't install the module.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants