Hi @Kabi,
There was an error in the documentation, we are working in correct it. Meanwhile you can follow these instructions:
How To Create A Custom PHP Application?
Many users run a Bitnami stack as a development environment for their own PHP projects (as opposed to running third-party applications such as Joomla! or WordPress). To deploy your PHP application in this environment, you have two options:
To make a single PHP application accessible at the root URL of the Web server (for example, http://localhost), simply copy the PHP files into the /opt/bitnami/apache2/htdocs folder. For an example, take a look at the phpinfo example.
To have several applications running, create the same structure used by Bitnami when installing Bitnami PHP applications. Recent versions of Bitnami stacks ship a demo application with this structure to help you get started. To use this, follow the steps below:
Copy the /opt/bitnami/docs/demo
folder into the /opt/bitnami/apps
directory.
sudo cp -a /opt/bitnami/docs/demo /opt/bitnami/apps/
Add the following line to the end of the /opt/bitnami/nginx/conf/bitnami/bitnami-apps-prefix.conf
file:
Include include "/opt/bitnami/apps/demo/conf/nginx-prefix.conf";
Restart the Nginx server using the command-line tool.
You should now be able to access the demo application at http://SERVER-IP/demo. You should see a "Hello world" message in your browser.
If your stack does not include a demo application, or if you prefer to create a custom PHP application from scratch, follow the steps below. These steps assume that your application will live in the ```/opt/bitnami/apps/myapp/``` directory:
Run the following commands to create the directories:
sudo mkdir /opt/bitnami/apps/myapp
sudo mkdir /opt/bitnami/apps/myapp/htdocs/
sudo mkdir /opt/bitnami/apps/myapp/conf
Create and edit the /opt/bitnami/apps/myapp/conf/nginx-prefix.conf file and add the line below to it:
location /demo {
alias "/opt/bitnami/apps/myapp/htdocs";
include "/opt/bitnami/apps/myapp/conf/nginx-app.conf";
}
Create and edit the /opt/bitnami/apps/myapp/conf/nginx-app.conf file and add the content below to it. This is the main configuration file for your application, so modify it further depending on your application's requirements.
index index.php index.html index.htm;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_read_timeout 300;
fastcgi_pass unix:/opt/bitnami/php/var/run/www.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
Restart the Nginx server:
```sudo /opt/bitnami/ctlscript.sh restart nginx```
You should now be able to access the application at http://SERVER-IP/myapp.
If you want to use a configuration using virtual hosts instead of prefix you mus esti the /opt/bitnami/apps/myapp/conf/nginx-vhost.conf in this way
```
server {
listen 80;
root "/opt/bitnami/apps/demo/htdocs";
server_name demo.example.com www.demo.example.com;
include "/opt/bitnami/apps/demo/conf/nginx-app.conf";
}
server {
listen 443 ssl;
root "/opt/bitnami/apps/demo/htdocs";
server_name demo.example.com www.demo.example.com;
ssl_certificate "/opt/bitnami/apps/demo/conf/certs/server.crt";
ssl_certificate_key "/opt/bitnami/apps/demo/conf/certs/server.key";
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
include "/opt/bitnami/apps/demo/conf/nginx-app.conf";
}
Restart the Nginx server:
sudo /opt/bitnami/ctlscript.sh restart nginx
You should now be able to access the application at http:/demo.example.com
| NOTE: You must have your host file or DNS well setted in order to work.