facebook / facebook/hhvm

fastcgi_param PHP_VALUE not working in Apache/Nginx

Open
#3,730 8 comments 1 reaction 1 assignee Assigned to @paulbiss View on GitHub
php5 incompatibility probably easy webserver
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

According to several comments on various sites, it should be possible to set PHP/HHVM configuration values via the fastcgi_param settings of your webservers host file.

I tried this with Apache 2.4 and nginx 1.4.1 on Ubuntu. In both cases the contents of the variable PHP_VALUE showed up within my script's $_SERVER variable, but had no effect on any ini setting.

Sample Nginx config:

```
location ~ \.(hh|php)$ {
fastcgi_keep_conn on;
fastcgi_pass unix:/var/run/hhvm/sock;
# fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_VALUE "include_path=\"$document_root/../includes\" \n error_log=\"$do
fastcgi_param SERVERTYPE dev;
include fastcgi_params;
}
```

Tried as local and TCP Socket. Both with PHP_VALUE and PHP_ADMIN_VALUE. Tried as a single setting and as multiple settings seperated by \n with and without quotes. No change whatsoever.

Tested with this PHP code:

```
include_path="/var/www/default/root/../includes"
error_log="/var/www/default/root/../log"
// shortened
)
```

The expected result would be that all settings in PHP_VALUE/PHP_ADMIN_VALUE are used as configuration settings.
A documentation page about what can and what can not be used and how would also be great.

```
Version: HipHop VM 3.0.1 (rel)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.