• Overview
    Key features
    • Observability
    • Auto-scaling
    • Multiframework
    • Security
    Frameworks
    • Django
    • Next.js
    • Drupal
    • WordPress
    • Symfony
    • Magento
    • See all frameworks
    Languages
    • PHP
    • Python
    • Node.js
    • Ruby
    • Java
    • Go
  • Industries
    • Consumer Goods
    • Media/Entertainment
    • Higher Education
    • Government
    • Ecommerce
  • Pricing
  • Featured articles
    • Switching to Platform.sh can help IT/DevOps organizations drive 219% ROI
    • Organizations, the ultimate way to manage your users and projects
  • Support
  • Docs
  • Login
  • Request a demo
  • Free Trial
Meet Upsun. The new, self-service, fully managed PaaS, powered by Platform.sh.Try it now
Blog
Thumbnail

Various ways to set variables

php
09 June, 2017
Larry Garfield
Larry Garfield
Director of Developer Experience

Platform.sh has always prided itself on offering our customers as much flexibility to control their own projects as we can. What language to use, what services to use, how the server should be configured, what applications to run, all of these are under the user's control. We even allow users to set various control variables and environment variables per-environment.

And now there's even another way to set them, via your application configuration file.

Platform.sh's variable support is designed to allow users to set per-environment configuration (such as API keys for 3rd party services) as well as to control aspects of the environment. Some applications, though, have their own environment variables they rely on for various reasons, such as to set a dev/prod toggle or control a build process. Those generally shouldn't vary by environment.

For that reason it's now possible to set variables from .platform.app.yaml. Those values will be tracked in Git just like the rest of your code base, keeping all of the important bits in the same place.

If you're using PHP, you can even use this system to set php.ini values. Need to change your memory limit? Set a prepend file? Control the error reporting level? That can all be done now directly from the .platform.app.yaml file.

For environment variables that should change per-environment or contain sensitive information the current mechanism (setting variables through the UI or using the CLI tool) nothing changes. Your current workflow is fine.

Get the latest Platform.sh news and resources
Subscribe

Related Content

Running with FrankenPHP on Platform.sh

Running with FrankenPHP on Platform.sh

Company
AboutSecurity and complianceTrust CenterCareersPressContact us
Thank you for subscribing!
  •  
Field required
Leader Winter 2023
System StatusPrivacyTerms of ServiceImpressumWCAG ComplianceAcceptable Use PolicyManage your cookie preferencesReport a security issue
© 2024 Platform.sh. All rights reserved.
Supported by Horizon 2020's SME Instrument - European Commission 🇪🇺