A fully-functional Symfony application that you can use as the skeleton for your new PHP applications on Bluemix.
For details on how to download and get started with Symfony, see the Installation chapter of the Symfony Documentation.
Scenario
-
Create Project
composer create-project symfony/framework-standard-edition:^3.1 phpsymfony
Note: When being asked the database parameters, keep the default.
-
Test locally
php bin/console server:run
If you get a Warning: date_default_timezone_get(), find your php.ini file with the following command: php -i | grep php.ini And then search for date.timezone and set it to "Europe/Amsterdam".
-
Open the URL in the browser. You should see Welcome to Symphony 3.1.6
-
Update the PHP version used in two place in the composer.json
"require": { "php": ">=7.0.12”, "symfony/symfony": "3.1.*", } "config": { "platform": { "php": "7.0.12" } },
-
Add manifest.yml
--- applications: - name: phpsymfony host: phpsymfony memory: 256M instances: 1 env: SYMFONY_ENV: prod
-
Add options.json in folder .bp-config
{ "PHP_VERSION": "{PHP_70_LATEST}", "WEBDIR": "web", "COMPOSER_VENDOR_DIR": "vendor" }
-
Add .user.ini file in root directory
# Display PHP errors in the web page when failing display_errors = On error_reporting = E_ALL
-
Add two files .cfignore and .gitignore with the following content:
vendor/ web/bundles