Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

Commit

Permalink
[docs] add PHP to languages-and-frameworks.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hellum committed Feb 7, 2020
1 parent 835f6e1 commit 0727a9a
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
Binary file added src/docs/images/phpDebug.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/docs/languages-and-frameworks.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ Below is a list of language and framework specific tips & tricks.
* [Go](/docs/go-in-gitpod/)
* [Bash](/docs/bash-in-gitpod/)
* [Ruby](/docs/ruby-in-gitpod)
* [PHP](/docs/php-in-gitpod)
* [Rust](/docs/rust-in-gitpod/)
* [Julia](/docs/julia-in-gitpod/)
4 changes: 4 additions & 0 deletions src/docs/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ export const MENU: MenuEntry[] = [
"Ruby",
"ruby-in-gitpod"
),
M(
"PHP",
"php-in-gitpod"
),
M(
"Rust",
"rust-in-gitpod"
Expand Down
55 changes: 55 additions & 0 deletions src/docs/php-in-gitpod.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# PHP in Gitpod

Gitpod Supports PHP right out of the box, but more advanced features such as Debugging and other tooling need to be configured, so here is how to do it!

## Example Repositories

| Repository | Description | Try it |
|------------|-------------|--------|
| magento2gitpod | Magento 2 optimized setup for Gitpod: Nginx, MySQL, PHP 7.2, PHP-FPM and more | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/nemke82/magento2gitpod) |
| koel | A personal music streaming server that works | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/phanan/koel) |
## VSCode Extensions
### PHP Debug

![](images/phpDebug.gif)
The PHP Debug extension allows debugging PHP applications from within Gitpod.

To add this extension to your repository, you must do two things:

First you must create a [`.gitpod.Dockerfile`](https://www.gitpod.io/docs/config-docker/):

```Dockerfile
FROM gitpod/workspace-full

USER gitpod

RUN sudo apt-get update -q \
&& sudo apt-get install -y php-dev

RUN wget http://xdebug.org/files/xdebug-2.9.1.tgz \
&& tar -xvzf xdebug-2.9.1.tgz \
&& cd xdebug-2.9.1 \
&& phpize \
&& ./configure \
&& make \
&& sudo cp modules/xdebug.so /usr/lib/php/20170718 \
&& sudo bash -c "echo -e '\nzend_extension = /usr/lib/php/20170718/xdebug.so\n[XDebug]\nxdebug.remote_enable = 1\nxdebug.remote_autostart = 1\n' >> /etc/php/7.2/cli/php.ini"
```

Second, reference the above Dockerfile in a [`.gitpod.yml`](https://www.gitpod.io/docs/config-gitpod-file/) file, then also install the extension, like so:

```yaml
image:
file: .gitpod.Dockerfile
# This is to get rid of the annoying popup feel free to leave this out
ports:
- port: 9000
onOpen: ignore
vscode:
extensions:
- [email protected]:WX8Y3EpQk3zgahy41yJtNQ==
```
Finally, here is an [example repository](https://github.com/JesterOrNot/Gitpod-PHP-Debug) that contains a full PHP debugging configuration for Gitpod as described above. You can try it by clicking here:
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/JesterOrNot/Gitpod-PHP-Debug)

0 comments on commit 0727a9a

Please sign in to comment.