1
1
---
2
- title : Building a PHP project
2
+ title : Build a PHP project
3
3
layout : en
4
4
5
5
---
6
6
7
- ## What This Guide Covers
8
7
9
8
<aside markdown =" block " class =" ataglance " >
10
9
@@ -31,7 +30,7 @@ and [General Build configuration](/user/customizing-the-build/) guides first.
31
30
32
31
PHP builds are not available on the macOS environment.
33
32
34
- ## Choosing PHP versions to test against
33
+ ## Test against PHP versions
35
34
36
35
Travis CI provides several PHP versions, all of which include XDebug and
37
36
PHPUnit. Travis CI uses [phpenv](https://github.com/CHH/phpenv) to manage the
63
62
{: data-file=".travis.yml"}
64
63
65
64
{% if site.data.language-details.php-versions.size > 0 %}
66
- # ## Supported PHP versions
65
+
66
+ # ## PHP Supported versions
67
67
68
68
The list of PHP versions available for on-demand installation can be found in
69
69
[the table below](#php-versions).
70
70
71
71
{% else %}
72
- # ## PHP 5.2(.x) - 5.3(.x) support is available on Precise only
73
72
74
- We do not support these versions on Trusty or Xenial or Bionic.
73
+ # ## Support for PHP version 5.2(.x) and 5.3(.x) are available on Precise only
74
+
75
+ We do not support these versions on Trusty, Xenial, or Bionic.
75
76
If you need to test them, please use Precise.
76
77
See [this page](/user/reference/trusty/#php-images) for more information.
77
78
78
- # ## PHP 5.4(.x) - 5.5(.x) support is available on Precise and Trusty only
79
+ # ## Support for PHP versions 5.4(.x) - 5.5(.x) are available on Precise and Trusty
79
80
80
81
We do not support these versions on Xenial or Bionic.
81
82
If you need to test them, please use Precise or Trusty.
82
83
See [this page](/user/reference/xenial/#php-images) for more information.
83
84
84
- # ## PHP 5.6(.x) - 7.0(.x) support is available on Precise, Trusty and Xenial only
85
+ # ## Support for PHP versions 5.6(.x) - 7.0(.x) are available on Precise, Trusty, and Xenial
85
86
86
87
We do not support these versions on Bionic.
87
- If you need to test them, please use Precise or Trusty or Xenial.
88
+ If you need to test them, please use Precise, Trusty, or Xenial.
88
89
See [this page](/user/reference/bionic/#php-support) for more information.
89
90
90
- # ## PHP 7.4(.x) onwards support is available on Trusty, Xenial and Bionic only
91
+ # ## Support for PHP versions 7.4(.x) and onwards are available on Trusty, Xenial, and Bionic
91
92
92
93
We do not support these versions on Precise.
93
94
If you need to test them, please use Trusty, Xenial, or Bionic.
94
95
{% endif %}
95
96
96
- # ## HHVM versions are available on Trusty only
97
+ # ## Test HHVM versions with Trusty
97
98
98
99
Travis CI can test your PHP applications with HHVM on Ubuntu Trusty :
99
100
@@ -144,7 +145,7 @@ and uses the first one found.
144
145
145
146
If your project uses something other than PHPUnit, you can [override the default build script](/user/customizing-the-build/).
146
147
147
- # ## Working with atoum
148
+ # ## Work with atoum
148
149
149
150
Instead of PHPunit, you can also use [atoum](https://github.com/atoum/atoum) to test your projects. For example :
150
151
@@ -175,7 +176,7 @@ install:
175
176
` ` `
176
177
{: data-file=".travis.yml"}
177
178
178
- # ## Testing Against Multiple Versions of Dependencies
179
+ # ## Test against Multiple Versions of Dependencies
179
180
180
181
If you need to test against multiple versions of, say, Symfony, you can instruct
181
182
Travis CI to do multiple runs with different sets or values of environment
@@ -201,7 +202,7 @@ install:
201
202
` ` `
202
203
{: data-file=".travis.yml"}
203
204
204
- Here we use DB variable value to pick phpunit configuration file :
205
+ Here, we use DB variable value to pick phpunit configuration file :
205
206
206
207
` ` ` yaml
207
208
script: phpunit --configuration $DB.phpunit.xml
@@ -210,13 +211,13 @@ Here we use DB variable value to pick phpunit configuration file:
210
211
211
212
The same technique is often used to test projects against multiple databases and so on.
212
213
213
- To see real world examples, see :
214
+ To see real- world examples, see :
214
215
215
216
- [FOSRest](https://github.com/FriendsOfSymfony/FOSRest/blob/master/.travis.yml)
216
217
- [LiipHyphenatorBundle](https://github.com/liip/LiipHyphenatorBundle/blob/master/.travis.yml)
217
218
- [doctrine2](https://github.com/doctrine/doctrine2/blob/master/.travis.yml)
218
219
219
- # ## Installing Composer packages
220
+ # ## Install Composer packages
220
221
221
222
<div class="note-box">
222
223
<p>
@@ -275,7 +276,7 @@ before_script: echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$(php
275
276
` ` `
276
277
{: data-file=".travis.yml"}
277
278
278
- # # Enabling preinstalled PHP extensions
279
+ # # Enable preinstalled PHP extensions
279
280
280
281
You need to enable them by adding an `extension="<extension>.so"` line to a PHP configuration file (for the current PHP version).
281
282
The easiest way to do this is by using `phpenv` to add a custom config file which enables and eventually configure the extension :
@@ -302,7 +303,7 @@ before_install: echo "extension = <extension>.so" >> ~/.phpenv/versions/$(phpenv
302
303
` ` `
303
304
{: data-file=".travis.yml"}
304
305
305
- # # Disabling preinstalled PHP extensions
306
+ # # Disable preinstalled PHP extensions
306
307
307
308
To disable xdebug, add this to your configuration :
308
309
@@ -312,7 +313,7 @@ before_script:
312
313
` ` `
313
314
{: data-file=".travis.yml"}
314
315
315
- # # Installing additional PHP extensions
316
+ # # Install additional PHP extensions
316
317
317
318
It is possible to install custom PHP extensions into the Travis CI environment
318
319
using [PECL](http://pecl.php.net/), but they have to be built against the PHP
@@ -345,15 +346,14 @@ install specific version with the `-f` flag. For example:
345
346
pecl install -f mongo-1.2.12
346
347
` ` `
347
348
348
- # ## Note on ` pecl install`
349
+ # ## Note on pecl install
349
350
350
351
Note that `pecl install` can fail if the requested version of the package is already installed.
351
352
352
353
353
-
354
354
# ## Apache + PHP
355
355
356
- Currently Travis CI does not support `mod_php` for apache, but you can configure
356
+ Currently, Travis CI does not support `mod_php` for apache, but you can configure
357
357
`php-fpm` for your integration tests :
358
358
359
359
` ` ` yaml
@@ -416,6 +416,7 @@ You can find more information on the build config format for [PHP](https://confi
416
416
- [Drupal](https://github.com/sonnym/travis-ci-drupal-module-example)
417
417
418
418
{% if site.data.language-details.php-versions.size > 0 %}
419
+
419
420
# # PHP versions
420
421
These archives are available for on-demand installation.
421
422
0 commit comments