简体   繁体   中英

How to use OpenShift 3 Online environment variables for PHP?

I tried getenv('OPENSHIFT_PHP_IP') and getenv('OPENSHIFT_PHP_PORT') both of which returned 1 which I assume is wrong...

I can't find the documentation for OpenShift 3 Online, only OpenShift 2 is currently available.

It depends on what you're trying to do. If you want to access your PHP application, you can access if by the automatic environment variables for OpenShift 3. There are also environment variables that you can set to control the PHP configuration . Finally, I'm unaware of any PHP application where you have to set the IP address and Port to listen on, but if you need to, you should specify '0.0.0.0' and '8080' as the host and port respectively.

Here's a sample Laravel PHP application for you look at for inspiration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM