26 Mar 2020 · Semaphore News

    Introducing Continuous Integration For PHP Projects On Semaphore

    3 min read
    Contents

    Today we’re really happy to announce our next step in platform expansion with full support for PHP projects on Semaphore. Developers working with all languages are embracing automated tools to develop web applications that meet requirements in a process that is both faster and safer comparing to old days of manual deployment and no tests. Now you can take advantage of Semaphore’s continuous integration and deployment features, already trusted by thousands of developers across the globe, in your PHP projects too.


    Sample test results of a PHP application.

    PHP is, without doubt, one of the most popular programming languages on the web. It is powering more than 240 million web pages (according to Wikipedia) and this number is still steadily growing. The famous LAMP stack, made of Linux, Apache, MySQL and PHP, was a driving force of open source web development that paved the way for many innovations both for developers and ordinary users across the globe. Lately, the rise of modern tools and frameworks such as Composer and Laravel is making development of robust PHP applications easier than ever.

    Setting up a PHP project on Semaphore

    To add your PHP project on Semaphore, first you’ll need to create an account. After that you will be able to add a new project from GitHub, right from your dashboard.

    After you’ve selected a branch to build and a brief repository analysis, Semaphore will automatically configure your project for testing. For example, if your project contains a composer.json file in its root directory, Semaphore will assume that it’s written in PHP and propose commands to install dependencies and run your tests.


    Semaphore can automatically configure your PHP project for continuous integration.

    At this point you can simply launch your first build or you can define your custom commands.

    The PHP stack

    Semaphore includes PHP versions 5.3, 5.4 and 5.5 out of the box. Internally, versions are managed with phpbrew. Choosing a PHP version in the interface corresponds to a command phpbrew switch . Exact current versions are documented here.

    Installing PHP extensions and packages

    PHP extensions can be installed with either PECL or PEAR. As an alternative, you can use

    phpbrew ext install 
    

    which downloads, installs, creates a config file and enables the extension. Packages can be installed with Composer and cached for reuse across builds.

    Testing

    PHPUnit is one of the most popular testing frameworks for PHP to date with a big community behind it and it’s installed by default in our platform. If you are using other tools which you’d like to be part of the platform, please let us know.

    Deployment

    Heroku has recently launched PHP support and Semaphore users can easily set up deployment of their PHP applications to its cloud platform. A generic deployment option via SSH key is also available. Either strategy enables you to ship new features, track releases and gain feedback faster than ever.

    PHP support on Semaphore is new to us as well so we may hit a few bumps along the way. We encourage you to contact us with your suggestions and feedback. Happy building!

    One thought on “Introducing Continuous Integration For PHP Projects On Semaphore

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    Avatar
    Writen by: