entertainmenttriada.blogg.se

Php runner templates
Php runner templates













php runner templates
  1. #Php runner templates code#
  2. #Php runner templates password#

* Database Service Name: mysql (this should match the service name for database created earlier) * Application domain name: .com **Remember** to substitute username Click on `edit parameters` link and change the following values: You will be taken to the screen where you can edit the template defaults like before. Just like before navigate to the templates area and choose the **cakephp-example** template. To add a frontend again press on `Add to Project` to spin up a frontend application in the same 'consoleproject'. It has a simple php file `dbtest.php` that connects to the database and reads the values from the users table and displays them.

#Php runner templates code#

The code is available on github to use atīrowse through the code in this repository. In this step we will add a PHP frontend application that talks to recently create database. **Step 4: Add a PHP frontend to talk to this database** Now `exit` MySQL client and `exit` out of the pod. Verify that the records you added are there Insert into users values (null, 'alice') So let us create a table and add some records using the commands shown below.Ĭreate table users (user_id int not null auto_increment, username varchar(200),PRIMARY KEY(user_id)) You will notice that the sample database that you requested is added and available.Ĭhange over to use the `sample` database. *Tip:* If you need service ip address navigate to `Browse->Services` tab on the Web Console.

php runner templates

You will have to substitute your values here. You used start the mysql client as shown below.

#Php runner templates password#

Now using the service ip address you noted earlier, port number, username and password You will be taken to a bash prompt inside the running pod. Substitute the podname with your mysql pod name. Note its name.Įnter the pod by running the following command. We can enter the pod and access the database using the CLI.įrom the command line, change the project to the "consoleproject-UserName" using commandīased on what you learnt previously get the list of running pods (Tip: `oc get pods`). The quickest way to enter the database pod is to browse to `Pods`, select the mysql pod and enter the terminal: Also note the port that is exposed by this service. You will note that the service has been assignedĪn IP address that starts with 172.*. !(images/mysql_pod_on_proj_details.png)īrowse over to Pods, Services and Deployments to notice the additions to the project. You will then be taken back to the project details page and soon you will see an image of a running pod. Click edit parameters and edit the values. You will be taken to the mysql ephemeral creation screen. But we will address that in a different lab exercise. You will also notice 'mysql-persistent' template. You can use the `Browse` drop down `Database` or `Filter` to select the `mysql-ephemeral` template from the list. You will be taken to the Select Image or Template page straight away. **Step 2: Create a MYSQL database using the template** Press the `Create` button to complete the project creation from the Web Console. Type in a `Display Name` and `Description` of your choice. Substitute your username to make this project unique. I am going to call it `consoleproject-username`

php runner templates

Using the `New Project` Button, create a new project. We will provide a route (a URL) to access the frontend application from a browser.īased on the experience gained from the previous exercise, log into the OpenShift Web Console. We will then add a frontend PHP application that accesses this database using the service exposed by the database. In this lab exercise we will learn to use OpenShift Web Console to spin up a MySQL database using templates.















Php runner templates