Skip to content

Commit 8cacc14

Browse files
Merge pull request #2447 from madeline-underwood/phpgc
Phpgc_JA to review
2 parents ef49759 + e7f6cc4 commit 8cacc14

File tree

6 files changed

+152
-136
lines changed

6 files changed

+152
-136
lines changed

content/learning-paths/servers-and-cloud-computing/php-on-gcp/_index.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
---
2-
title: Deploy PHP on Google Cloud C4A (Arm-based Axion VMs)
2+
title: Deploy PHP on Google Cloud C4A Arm-based Axion VMs
33

4-
draft: true
5-
cascade:
6-
draft: true
7-
4+
85
minutes_to_complete: 30
96

10-
who_is_this_for: This is an introductory topic for software developers migrating PHP workloads from x86_64 to Arm-based servers, specifically on Google Cloud C4A virtual machines built on Axion processors.
11-
7+
who_is_this_for: This is an introductory topic for developers migrating Hypertext Preprocesso (PHP) workloads from x86_64 to Arm-based servers, specifically on Google Cloud C4A virtual machines (VM) built on Axion processors.
128

139
learning_objectives:
14-
- Provision a SUSE SLES virtual machine on Google Cloud C4A (Arm-based Axion VM)
15-
- Install PHP on a SUSE Arm64 (C4A) instance
16-
- Validate PHP functionality with baseline HTTP server tests
10+
- Provision a SUSE Linux Enterprise Server (SLES) virtual machine on a Google Cloud C4A Arm-based Axion virtual machine
11+
- Install PHP on a SUSE Arm64 C4A instance
12+
- Validate PHP functionality by running baseline HTTP server tests
1713
- Benchmark PHP performance using PHPBench on Arm64 architecture
1814

1915

@@ -32,7 +28,7 @@ armips:
3228

3329
tools_software_languages:
3430
- PHP
35-
- apache
31+
- Apache
3632
- PHPBench
3733

3834
operatingsystems:
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
---
2-
title: Get started with PHP on Google Axion C4A (Arm Neoverse V2)
2+
title: Get started with PHP on Google Cloud Axion C4A Arm VMs
33

44
weight: 2
55

66
layout: "learningpathall"
77
---
88

9-
## Google Axion C4A Arm instances in Google Cloud
9+
## PHP
1010

11-
Google Axion C4A is a family of Arm-based virtual machines built on Google’s custom Axion CPU, which is based on Arm Neoverse V2 cores. Designed for high-performance and energy-efficient computing, these virtual machines offer strong performance for modern cloud workloads such as CI/CD pipelines, microservices, media processing, and general-purpose applications.
11+
PHP (Hypertext Preprocessor) is an open-source, server-side scripting language designed for web development. You can embed PHP directly into HTML, making it easy to generate content dynamically on the server before sending it to the browser. PHP is widely used for websites, web applications, content management systems (CMS), and APIs. For more information, see the [PHP website](https://www.php.net/) and the [PHP documentation](https://www.php.net/docs.php).
1212

13-
The C4A series provides a cost-effective alternative to x86 virtual machines while leveraging the scalability and performance benefits of the Arm architecture in Google Cloud.
1413

15-
To learn more about Google Axion, refer to the [Introducing Google Axion Processors, our new Arm-based CPUs](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu) blog.
14+
## Google Axion C4A
1615

17-
## PHP
16+
Google Axion C4A is a family of Arm-based virtual machines powered by Google's Axion CPU, built with Arm Neoverse V2 cores. They deliver high performance and energy efficiency for cloud workloads such as CI/CD pipelines, microservices, media processing, and general-purpose applications. The C4A series provides a cost-effective alternative to x86 virtual machines while leveraging the scalability and performance benefits of the Arm architecture in Google Cloud.
1817

19-
PHP (Hypertext Preprocessor) is an open-source, server-side scripting language designed for web development.
18+
For more information on Google Axion, see the Google blog [Introducing Google Axion Processors, our new Arm-based CPUs](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu).
2019

21-
It allows developers to create dynamic web pages, interact with databases, handle forms, and build web applications. PHP can be embedded directly into HTML, making it easy to generate content dynamically on the server before sending it to the browser.
20+
## What's next?
2221

23-
PHP is widely used for websites, web applications, content management systems (CMS), and APIs. Learn more from the [PHP official website](https://www.php.net/) and its [official documentation](https://www.php.net/docs.php).
22+
You’re now ready to begin deploying PHP workloads on Arm-based Google Cloud Axion C4A VMs. This Learning Path shows you how to optimize PHP for Arm servers, benchmark performance, and migrate from x86 to Arm with confidence.

content/learning-paths/servers-and-cloud-computing/php-on-gcp/baseline.md

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
---
2-
title: PHP baseline testing on Google Axion C4A Arm Virtual Machine
2+
title: Validate PHP baseline on Google Cloud Axion C4A Arm VM
33
weight: 5
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

99

10-
## Baseline Setup for PHP-FPM
11-
This section guides you through configuring PHP-FPM (FastCGI Process Manager) on a SUSE Arm-based Google Cloud C4A virtual machine. You will prepare the PHP-FPM pool configuration, verify PHP's FastCGI setup, and later connect it to Apache to confirm end-to-end functionality.
10+
## Configure PHP-FPM baseline
11+
In this section, you’ll configure PHP-FPM (FastCGI Process Manager) on a SUSE Linux Arm-based Google Cloud Axion C4A virtual machine. You’ll set up the PHP-FPM pool and verify the FastCGI configuration. Next, you’ll connect PHP-FPM to Apache. These steps confirm that your Arm server is ready for dynamic PHP workloads.
1212

13-
### Configure the PHP-FPM Pool
13+
## Set up the PHP-FPM pool
1414

15-
PHP-FPM (FastCGI Process Manager) runs PHP scripts in dedicated worker processes that are independent of the web server.
16-
This design improves performance, security, and fault isolation — especially useful on multi-core Arm-based processors like Google Cloud’s Axion C4A VMs.
15+
PHP-FPM (FastCGI Process Manager) runs PHP scripts in dedicated worker processes, independent of the web server. You’ll notice better performance, stronger security, and improved fault isolation when you use multi-core Arm-based processors like Google Cloud Axion C4A VMs.
1716

18-
A pool defines a group of PHP worker processes, each serving incoming FastCGI requests. Different applications or virtual hosts can use separate pools for better resource control.
17+
A pool is a group of PHP worker processes that serve FastCGI requests. You can use separate pools for different applications or virtual hosts to control resources more effectively.
1918

20-
### Copy the Default Configuration (if missing)
19+
## Copy the default configuration
2120

2221
If your PHP-FPM configuration files don't exist yet (for example, after a minimal installation in this Learning Path), copy the defaults into place using the commands below:
2322

2423
```console
2524
sudo cp /etc/php8/fpm/php-fpm.d/www.conf.default /etc/php8/fpm/php-fpm.d/www.conf
2625
sudo cp /etc/php8/fpm/php-fpm.conf.default /etc/php8/fpm/php-fpm.conf
2726
```
28-
These commands:
29-
Create a default pool configuration (www.conf) that controls how PHP-FPM spawns and manages worker processes.
30-
Restore the main FPM service configuration (php-fpm.conf) if it's missing.
27+
These commands do the following:
28+
- Create a default pool configuration (`www.conf`) to control how PHP-FPM spawns and manages worker processes
29+
- Restore the main FPM service configuration (`php-fpm.conf`) if its missing
3130

32-
### Edit the Configuration
31+
## Edit the PHP-FPM configuration
3332

3433
Open the PHP-FPM pool configuration file in a text editor:
3534

@@ -51,7 +50,7 @@ listen.group = www
5150
listen.mode = 0660
5251
```
5352

54-
Explanation of each directive:
53+
This table gives you an explanation of each directive:
5554
| Directive | Description |
5655
| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5756
| listen = /run/php-fpm/[www.sock](http://www.sock) | Configures PHP-FPM to communicate with Apache using a local Unix socket instead of a TCP port (`127.0.0.1:9000`). This reduces network overhead and improves performance. |
@@ -60,7 +59,7 @@ Explanation of each directive:
6059
| listen.mode = 0660 | Defines file permissions so that both the owner (`wwwrun`) and group (`www`) can read and write to the socket. This enables smooth communication between Apache and PHP-FPM. |
6160

6261

63-
### Start and Enable PHP-FPM
62+
## Start and enable PHP-FPM service
6463

6564
After updating the configuration, restart the PHP-FPM service so it picks up the new settings:
6665

@@ -91,11 +90,11 @@ You should see output similar to:
9190
Oct 16 13:56:44 pareena-php-test systemd[1]: Starting The PHP FastCGI Process Manager...
9291
Oct 16 13:56:44 pareena-php-test systemd[1]: Started The PHP FastCGI Process Manager.
9392
```
94-
PHP-FPM is now active and ready to process requests via its Unix socket (/run/php-fpm/www.sock).
95-
Next, you will configure Apache to communicate with PHP-FPM, allowing your server to process and serve dynamic PHP pages.
93+
PHP-FPM is now active and ready to process requests using its Unix socket (`/run/php-fpm/www.sock`).
94+
Next, you’ll configure Apache to communicate with PHP-FPM, allowing your Arm server to process and serve dynamic PHP pages.
9695

9796
## Install the Apache PHP8 module
98-
If you prefer to have Apache handle PHP execution directly (instead of using PHP-FPM), you can install the Apache PHP 8 module, which integrates PHP into Apache using the `mod_php` interface:
97+
If you want Apache to handle PHP execution directly (instead of using PHP-FPM), install the Apache PHP 8 module, which integrates PHP into Apache using the `mod_php` interface:
9998

10099
```console
101100
sudo zypper install apache2-mod_php8
@@ -105,28 +104,26 @@ Once the module is installed, restart Apache to load the new configuration:
105104
```console
106105
sudo systemctl restart apache2
107106
```
108-
Next, you will test PHP execution by creating a simple PHP page and verifying that Apache can correctly render dynamic content.
107+
Next, you’ll test PHP execution by creating a simple PHP page and verifying that Apache can correctly render dynamic content.
109108

110-
## Test PHP
111-
Now that PHP and Apache are installed, you can verify that everything is working correctly.
109+
## Test PHP functionality
110+
Now that PHP and Apache are installed, you can verify that everything is working correctly on your Arm-based VM.
112111

113-
### Create a Test Page
112+
## Create a PHP test page
114113
Create a simple PHP file that displays detailed information about your PHP installation:
115114

116115
```console
117116
echo "<?php phpinfo(); ?>" | sudo tee /srv/www/htdocs/info.php
118117
```
119-
This creates a file named `info.php` inside Apache's web root directory `(/srv/www/htdocs/)`. When you open this file in a browser, it will display the PHP configuration page.
118+
This creates a file named `info.php` inside Apaches web root directory (`/srv/www/htdocs/`). When you open this file in a browser, it displays the PHP configuration page.
120119

121-
### Test from Inside the VM
120+
## Verify PHP from inside the VM
122121
You can verify that PHP and Apache are communicating correctly by testing the web server locally using curl:
123122

124123
```console
125124
curl http://localhost/info.php
126125
```
127-
- `curl` fetches the page from the local Apache server.
128-
- If PHP is working, you will see a large block of HTML code as output. This is the rendered output of the phpinfo() function.
129-
- This confirms that Apache successfully passed the request to the PHP interpreter and returned the generated HTML response.
126+
When you run the `curl` command, it fetches the PHP test page from the local Apache server. If PHP is configured correctly, you'll see a large block of HTML code in the output, which is the result of the `phpinfo()` function. This confirms that Apache is successfully passing requests to the PHP interpreter and returning the generated HTML response.
130127

131128
You should see output similar to:
132129

@@ -148,20 +145,25 @@ h1 {font-size: 150%;}
148145
h2 {font-size: 125%;}
149146
h2 a:link, h2 a:visited{color: inherit; background: inherit;}
150147
```
151-
This long HTML output represents the PHP configuration page content.
148+
This long HTML output represents the PHP configuration page content.
152149

153-
### Test from Your Browser
154-
Now, let's verify that your PHP setup works correctly from outside the VM.
150+
## Verify PHP from your browser
151+
Now, verify that your PHP setup works correctly from outside the VM.
155152
Open a web browser on your local machine (such as Chrome, Firefox, or Edge) and enter the following URL in the address bar:
156153

157154
```console
158155
http://<YOUR_VM_PUBLIC_IP>/info.php
159156
```
160-
- Replace `<YOUR_VM_PUBLIC_IP>` with the public IP of your Google Cloud Axion VM.
157+
Replace `<YOUR_VM_PUBLIC_IP>` with the public IP of your Google Cloud Axion C4A Arm VM.
161158

162-
If everything is set up correctly, you will see a PHP Info page in your browser. It looks like this:
159+
If your configuration is correct, your browser displays the PHP Info page. This page shows detailed information about your PHP environment, including version, build options, and loaded modules, as shown below:
163160

164-
![PHP-info page alt-text#center](images/php-web.png "Figure 1: PHP info")
161+
![Screenshot of PHP info page in browser showing PHP configuration details on Google Cloud Axion C4A Arm VM. alt-text#center](images/php-web.png "PHP info page in browser on Google Cloud Axion C4A Arm VM")
165162

166-
Successfully loading the PHP Info page in your browser confirms that your PHP and Apache environment on Google Cloud C4A is configured and functioning properly.
167-
You are now ready to proceed to the benchmarking and performance testing phase.
163+
Successfully loading the PHP Info page in your browser confirms that your PHP and Apache environment on Google Cloud Axion C4A Arm is configured and functioning properly.
164+
165+
## What's next?
166+
167+
You’ve validated your PHP baseline setup on an Arm-based Google Cloud VM. You’re ready to move on to benchmarking and performance testing for your PHP workloads on Arm.
168+
169+
Next, you’ll learn how to measure PHP performance on Google Cloud Axion C4A Arm VMs. You’ll use benchmarking tools to evaluate throughput, latency, and resource utilization. This helps you optimize your PHP environment for production workloads and identify areas for improvement.

0 commit comments

Comments
 (0)