You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With NGINX, you need to use a process manager such as [supervisord](http://supervisord.org/) to manage instances of your application. Have a look at [AstroSplash](http://astrosplash.com/) for an [example supervisord configuration](https://github.com/AndrewCarterUK/AstroSplash/blob/master/supervisord.conf).
63
+
With NGINX, you need to use a process manager such as [supervisord](http://supervisord.org/)
64
+
to manage instances of your application. Have a look at [AstroSplash](http://astrosplash.com/)
65
+
for an [example supervisord configuration](https://github.com/AndrewCarterUK/AstroSplash/blob/master/supervisord.conf).
64
66
65
-
Below is an example of the modification that you would make to the [Symfony NGINX configuration](https://www.nginx.com/resources/wiki/start/topics/recipes/symfony/). The core principle is to replace the PHP-FPM reference with one to a cluster of workers.
67
+
Below is an example of the modification that you would make to the
Then add the following to your VirtualHost config:
99
+
For development you only need to start you application (see [Running the server](#running-the-server)) then add the
100
+
following to your VirtualHost config:
104
101
105
102
```
106
103
<FilesMatch ^index\.php$>
@@ -114,41 +111,118 @@ to exist but could be an empty file.
114
111
115
112
### Apache 2.0 - 2.2
116
113
117
-
If you wish to configure your FastCGI application to work with the apache web server, you can use the apache FastCGI module to process manage your application.
114
+
If you wish to configure your FastCGI application to work with the apache web server,
115
+
you can use the apache FastCGI module to process manage your application.
118
116
119
-
This can be done by creating a FCGI script that launches your application and inserting a FastCgiServer directive into your virtual host configuration.
117
+
This can be done by creating a FCGI script that launches your application and inserting
118
+
a FastCgiServer directive into your virtual host configuration.
120
119
121
120
Here is an example `script.fcgi`:
122
121
123
122
```sh
124
123
#!/bin/bash
124
+
125
+
# Run the server
125
126
php /path/to/application.php run
126
127
```
127
128
128
-
Or with Symfony:
129
+
See other commands to run the server [here](#running-the-server).
129
130
130
-
```sh
131
-
#!/bin/bash
132
-
php /path/to/bin/console speedfony:run --env=prod
133
-
```
134
131
135
-
In your configuration, you can use the [FastCgiServer](https://web.archive.org/web/20150913190020/http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html#FastCgiServer) directive to inform Apache of your application.
132
+
In your configuration, you can use the [FastCgiServer](https://web.archive.org/web/20150913190020/http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html#FastCgiServer)
133
+
directive to inform Apache of your application.
136
134
137
135
```
138
136
FastCgiServer /path/to/script.fcgi
139
137
```
140
138
141
-
By default, the daemon will listen on FCGI_LISTENSOCK_FILENO, but it can also be configured to listen on a TCP address. For example:
139
+
## Running the server
142
140
141
+
Depending on your setup, you will have different ways of running the server. In
142
+
a normal PHP application where you have created your own `fastCGI_app.php` ([see how](#usage)),
143
+
you may start the server simply by:
143
144
144
-
```sh
145
-
#!/bin/bash
146
-
php /path/to/application.php run --port=5000 --host=localhost
145
+
```bash
146
+
php /path/to/fastCGI_app.php run
147
147
```
148
148
149
-
Or with Symfony:
149
+
In a Symfony application where you have registered `DaemonRunCommand` as a service,
0 commit comments