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
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/php-on-gcp/_index.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,10 @@ title: Deploy PHP on Google Cloud C4A Arm-based Axion VMs
4
4
5
5
minutes_to_complete: 30
6
6
7
-
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 (VM) built on Axion processors.
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.
8
8
9
9
learning_objectives:
10
-
- Provision a SUSE SLES virtual machine on a Google Cloud C4A Arm-based Axion virtual machine
10
+
- Provision a SUSE Linux Enterprise Server (SLES) virtual machine on a Google Cloud C4A Arm-based Axion virtual machine
11
11
- Install PHP on a SUSE Arm64 C4A instance
12
12
- Validate PHP functionality by running baseline HTTP server tests
13
13
- Benchmark PHP performance using PHPBench on Arm64 architecture
title: Get started with PHP on Google Axion C4A on Arm Neoverse V2
2
+
title: Get started with PHP on Google Cloud Axion C4A Arm VMs
3
3
4
4
weight: 2
5
5
6
6
layout: "learningpathall"
7
7
---
8
8
9
-
## Google Axion C4A Arm instances in Google Cloud
9
+
## PHP
10
10
11
-
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.
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).
12
12
13
-
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).
14
13
15
-
## PHP
14
+
## Google Axion C4A
16
15
17
-
PHP (Hypertext Preprocessor) is an open-source, server-side scripting language designed for web development.
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.
18
17
19
-
You use PHP to:
20
-
- Create dynamic web pages
21
-
- Interact with databases
22
-
- Handle forms
23
-
- Build web applications and APIs
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).
24
19
25
-
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).
20
+
## What's next?
26
21
27
-
You’re now ready to begin deploying PHP workloads on Arm-based Google Cloud Axion C4A VMs. This Learning Path helps you optimize PHP for Arm servers, benchmark performance, and migrate from x86 to Arm with confidence.
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.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/php-on-gcp/baseline.md
+21-19Lines changed: 21 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,28 +7,28 @@ layout: learningpathall
7
7
---
8
8
9
9
10
-
## Baseline setup for PHP-FPM
10
+
## Configure PHP-FPM baseline
11
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.
12
12
13
-
## Configure the PHP-FPM pool
13
+
## Set up the PHP-FPM pool
14
14
15
-
PHP-FPM (FastCGI Process Manager) runs PHP scripts in dedicated worker processes, independent of the web server. This design improves performance, security, and fault isolation—especially on multi-core Arm-based processors like Google Cloud 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.
16
16
17
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.
18
18
19
-
## Copy the default configuration (if missing)
19
+
## Copy the default configuration
20
20
21
21
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:
| 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. |
@@ -59,7 +59,7 @@ Explanation of each directive:
59
59
| 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. |
60
60
61
61
62
-
## Start and enable PHP-FPM
62
+
## Start and enable PHP-FPM service
63
63
64
64
After updating the configuration, restart the PHP-FPM service so it picks up the new settings:
65
65
@@ -90,7 +90,7 @@ You should see output similar to:
90
90
Oct 16 13:56:44 pareena-php-test systemd[1]: Starting The PHP FastCGI Process Manager...
91
91
Oct 16 13:56:44 pareena-php-test systemd[1]: Started The PHP FastCGI Process Manager.
92
92
```
93
-
PHP-FPM is now active and ready to process requests via its Unix socket (`/run/php-fpm/www.sock`).
93
+
PHP-FPM is now active and ready to process requests using its Unix socket (`/run/php-fpm/www.sock`).
94
94
Next, you’ll configure Apache to communicate with PHP-FPM, allowing your Arm server to process and serve dynamic PHP pages.
Next, you’ll test PHP execution by creating a simple PHP page and verifying that Apache can correctly render dynamic content.
108
108
109
-
## Test PHP
109
+
## Test PHP functionality
110
110
Now that PHP and Apache are installed, you can verify that everything is working correctly on your Arm-based VM.
111
111
112
-
## Create a test page
112
+
## Create a PHP test page
113
113
Create a simple PHP file that displays detailed information about your PHP installation:
114
114
115
115
```console
116
116
echo "<?php phpinfo(); ?>" | sudo tee /srv/www/htdocs/info.php
117
117
```
118
118
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 displays the PHP configuration page.
119
119
120
-
## Test from inside the VM
120
+
## Verify PHP from inside the VM
121
121
You can verify that PHP and Apache are communicating correctly by testing the web server locally using curl:
122
122
123
123
```console
124
124
curl http://localhost/info.php
125
125
```
126
-
-`curl` fetches the page from the local Apache server.
127
-
- If PHP is working, you’ll see a large block of HTML code as output. This is the rendered output of the `phpinfo()` function.
128
-
- 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.
This long HTML output represents the PHP configuration page content.
151
149
152
-
## Test from your browser
150
+
## Verify PHP from your browser
153
151
Now, verify that your PHP setup works correctly from outside the VM.
154
152
Open a web browser on your local machine (such as Chrome, Firefox, or Edge) and enter the following URL in the address bar:
155
153
156
154
```console
157
155
http://<YOUR_VM_PUBLIC_IP>/info.php
158
156
```
159
-
-Replace `<YOUR_VM_PUBLIC_IP>` with the public IP of your Google Cloud Axion C4A Arm VM.
157
+
Replace `<YOUR_VM_PUBLIC_IP>` with the public IP of your Google Cloud Axion C4A Arm VM.
160
158
161
-
If everything is set up correctly, you’ll 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:

164
162
165
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.
166
164
165
+
## What's next?
166
+
167
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.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/php-on-gcp/benchmarking.md
+21-23Lines changed: 21 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,7 @@ layout: learningpathall
8
8
9
9
## PHP benchmarking using PHPBench
10
10
11
-
In this section, you will learn how to benchmark PHP performance using PHPBench, a modern and extensible benchmarking framework for PHP applications. You will install PHPBench, run sample tests, and interpret key metrics such as mode time, variance, and throughput. You will then analyze the results to understand how your Google Cloud C4A (Axion Arm64) virtual machine performs on common operations like string manipulation and array processing.
12
-
13
-
PHPBench is a flexible micro-benchmarking tool designed to measure PHP code performance precisely and repeatably.
11
+
In this section, you will learn how to benchmark PHP performance using PHPBench, a modern and extensible benchmarking framework for PHP applications. You will install PHPBench, run sample tests, and interpret key metrics such as mode time, variance, and throughput. You will then analyze the results to understand how your Google Cloud C4A (Axion Arm64) virtual machine performs on common operations like string manipulation and array processing. PHPBench is a flexible micro-benchmarking tool designed to measure PHP code performance precisely and repeatably.
14
12
15
13
With PHPBench, you can:
16
14
* Measure the execution time of PHP functions or code blocks
@@ -93,7 +91,7 @@ This installs `phpbench` in your user's global Composer directory, typically loc
93
91
94
92
## Add Composer global bin to PATH
95
93
96
-
To make `phpbench` accessible from any terminal session, add Composer's global binary path to your system's environment PATH:
94
+
To make `phpbench` accessible from any terminal session, add Composer's global binary path to your system's environment `PATH`:
This sets up two basic benchmark tests, string concatenation and array push.
162
160
163
-
-@Revs(1000): Each benchmark repeats 1000 times per iteration.
164
-
-@Iterations(5): The benchmark runs 5 separate iterations and averages results.
165
-
-`benchStringConcat` and `benchArrayPush`: Sample benchmarks for string and array operations.
161
+
The `@Revs(1000)` annotation ensures each benchmark function is executed 1,000 times per iteration, while `@Iterations(5)` means the benchmark runs five separate iterations and averages the results for greater accuracy. The sample benchmarks, `benchStringConcat` and `benchArrayPush`, measure the performance of string concatenation and array operations, respectively.
166
162
167
163
## Run the benchmarks
168
164
@@ -185,20 +181,19 @@ with PHP version 8.0.30, xdebug ❌, opcache ❌
|**benchStringConcat**| Name of the benchmark function; measures string concatenation performance. |
191
+
|**benchArrayPush**| Name of the benchmark function; measures array push performance. |
192
+
|**xdebug ❌**| Xdebug extension is disabled, which is good because Xdebug slows down execution. |
193
+
|**opcache ❌**| Opcache is disabled, so you’re measuring raw execution without caching optimizations. |
194
+
|**I4**| Number of iterations per measurement. `I4` means 4 iterations of this benchmark were executed per run. |
195
+
|**Mo13.438μs**| Mode (most common) execution time for the benchmark. `13.438 μs` = 13.438 microseconds per iteration. |
196
+
|**(±0.82%)**| Variation or coefficient of variation in the measurements. Lower percentage means more stable results. |
202
197
203
198
204
199
## Benchmark summary on Arm64
@@ -222,10 +217,13 @@ For comparison, the same PHPBench test suite was executed on a Google Cloud c4-s
222
217
223
218
When comparing benchmark results between Google Cloud Axion C4A (Arm64) and x86-based C4 (x86_64) instances, you will see:
224
219
225
-
The results show that both architectures deliver nearly identical execution times for typical PHP operations, with Arm64 showing slightly lower variation (more stable performance). The Arm64 instance performs within ~15% of x86_64, showing strong memory throughput and cache performance for dynamic array allocation workloads.
226
-
Low variance (±0.82% / ±0.51: Indicates that the Axion-based Arm cores on C4A provide stable, repeatable performance, ideal for predictable PHP application behavior in production.
220
+
- The results show that both architectures deliver nearly identical execution times for typical PHP operations, with Arm64 showing a slightly lower level of variation which indicates more stable performance.
221
+
- The Arm64 instance performs within ~15% of x86_64, showing strong memory throughput and cache performance for dynamic array allocation workloads.
222
+
- Low variance (±0.82% / ±0.51) indicates that the Axion-based Arm cores on C4A provide stable, repeatable performance, ideal for predictable PHP application behavior in production.
223
+
224
+
## Summary
227
225
228
-
These results show that PHP performs consistently across both architectures, and that Google Cloud Axion C4A Arm64 VMs deliver competitive, reliable performance for PHP-based web and backend applications.
226
+
These results show that PHP performs consistently across both architectures, and that Google Cloud Axion C4A Arm64 VMs deliver competitive, reliable performance for PHP-based web and backend applications. You can confidently deploy PHP workloads on Arm64 instances, knowing that performance is stable and comparable to x86_64 systems. This benchmarking process helps you identify areas for optimization and ensures your applications run efficiently on Arm platforms. As you continue developing and scaling PHP solutions, regularly benchmarking on Arm64 will help you maintain high performance and take advantage of the cost and energy efficiency benefits offered by Arm-based cloud infrastructure.
0 commit comments