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,7 +4,7 @@ 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 software developers migrating 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
10
- Provision a SUSE SLES virtual machine on a Google Cloud C4A Arm-based Axion virtual machine
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/php-on-gcp/background.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,4 +26,4 @@ You can embed PHP directly into HTML, making it easy to generate content dynamic
26
26
27
27
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).
28
28
29
-
You’re 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.
29
+
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.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/php-on-gcp/baseline.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,16 +7,16 @@ layout: learningpathall
7
7
---
8
8
9
9
10
-
## Baseline Setup for PHP-FPM
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, verify FastCGI configuration, connect PHP-FPM to Apache, and confirm that your Arm server is ready for dynamic PHP workloads.
10
+
## Baseline setup for PHP-FPM
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
+
## Configure the PHP-FPM pool
14
14
15
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.
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 (if missing)
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:
- 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 it’s missing.
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 it’s missing
30
30
31
-
###Edit the Configuration
31
+
## Edit the configuration
32
32
33
33
Open the PHP-FPM pool configuration file in a text editor:
34
34
@@ -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
63
63
64
64
After updating the configuration, restart the PHP-FPM service so it picks up the new settings:
65
65
@@ -109,15 +109,15 @@ Next, you’ll test PHP execution by creating a simple PHP page and verifying th
109
109
## Test PHP
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 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
+
## Test from inside the VM
121
121
You can verify that PHP and Apache are communicating correctly by testing the web server locally using curl:
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/php-on-gcp/benchmarking.md
+23-21Lines changed: 23 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,18 +7,20 @@ layout: learningpathall
7
7
---
8
8
9
9
10
-
## PHP Benchmarking using PHPBench
10
+
## PHP benchmarking using PHPBench
11
11
12
12
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.
13
13
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.
14
14
15
-
PHPBench is a flexible micro-benchmarking tool designed to measure PHP code performance precisely and repeatably. It allows developers to:
16
-
* Measure the execution time of PHP functions or code blocks.
17
-
* Identify performance regressions between versions.
18
-
* Automate performance testing across CI/CD pipelines.
19
-
* Track results over time to detect optimizations or slowdowns.
15
+
PHPBench is a flexible micro-benchmarking tool designed to measure PHP code performance precisely and repeatably.
20
16
21
-
### Download Composer Installer
17
+
It allows developers to do the following:
18
+
* Measure the execution time of PHP functions or code blocks
19
+
* Identify performance regressions between versions
20
+
* Automate performance testing across CI/CD pipelines
21
+
* Track results over time to detect optimizations or slowdowns
22
+
23
+
## Download Composer installer
22
24
23
25
Before installing PHPBench, you need Composer, which is PHP's dependency manager. Composer handles library installations, versioning, and autoloading, ensuring tools like PHPBench run consistently across environments.
This command downloads a PHP script called `composer-setup.php`, which will install Composer.
31
33
32
-
###Install the phar extension
34
+
## Install the phar extension
33
35
34
36
Composer requires PHP's phar (PHP Archive) extension to run. This extension allows PHP to execute .phar archive files, self-contained PHP applications like Composer and PHPBench are distributed in this format.
35
37
@@ -38,7 +40,7 @@ Install the extension with:
38
40
sudo zypper install -y php8-phar
39
41
```
40
42
41
-
###Install Composer system-wide
43
+
## Install Composer system-wide
42
44
43
45
Now, install Composer globally so it is available for all users and can be executed from any directory:
44
46
@@ -56,7 +58,7 @@ Use it: php /usr/local/bin/composer
56
58
```
57
59
Composer is now installed system-wide at /usr/local/bin/composer and ready to manage PHP dependencies.
58
60
59
-
###Remove the installer script
61
+
## Remove the installer script
60
62
61
63
After successfully installing Composer, remove the installer file to keep your environment clean:
Since Composer is now installed system-wide, the installer file is no longer needed.
67
69
68
-
###Verify Composer installation
70
+
## Verify Composer installation
69
71
To confirm that Composer was installed correctly and is accessible globally, run:
70
72
71
73
```console
@@ -80,7 +82,7 @@ Run the "diagnose" command to get more detailed diagnostics output.
80
82
81
83
Composer is now successfully installed and you can proceed to installing PHPBench.
82
84
83
-
###Install PHPBench globally
85
+
## Install PHPBench globally
84
86
85
87
PHPBench is a powerful benchmarking tool for measuring the performance of PHP code. Install it globally using Composer so you can access it from any directory:
86
88
@@ -90,7 +92,7 @@ composer global require phpbench/phpbench
90
92
91
93
This installs `phpbench` in your user's global Composer directory, typically located under `$HOME/.config/composer/`
92
94
93
-
###Add Composer global bin to PATH
95
+
## Add Composer global bin to PATH
94
96
95
97
To make `phpbench` accessible from any terminal session, add Composer's global binary path to your system's environment PATH:
- Lower percentage → more stable and reliable benchmark.
201
203
202
204
203
-
###Benchmark summary on Arm64
205
+
## Benchmark summary on Arm64
204
206
205
207
Results from the benchmark suite executed on a Google Cloud c4a-standard-4 (Arm64) instance with 4 vCPUs and 16 GB memory, running SUSE Linux:
206
208
| Benchmark Function | Iterations | Mode Execution Time (μs)| Variation (%) | Notes |
@@ -209,15 +211,15 @@ Results from the benchmark suite executed on a Google Cloud c4a-standard-4 (Arm6
209
211
| benchArrayPush | I4 | 8.487 μs | ±0.51% | Measures performance of pushing elements to an array|
210
212
211
213
212
-
###Benchmark summary on x86_64
214
+
## Benchmark summary on x86_64
213
215
For comparison, the same PHPBench test suite was executed on a Google Cloud c4-standard-4 (x86_64) instance with 4 vCPUs and 15 GB memory, running SUSE Linux:
214
216
215
217
| Benchmark Function | Iterations | Mode Execution Time (μs) | Variation (%) | Notes |
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/php-on-gcp/installation.md
+23-21Lines changed: 23 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,44 +6,42 @@ weight: 4
6
6
layout: learningpathall
7
7
---
8
8
9
-
## Install PHP
10
-
In this section, you will install PHP together with the Apache web server and several commonly used PHP extensions on a SUSE Arm-based virtual machine. This forms the foundation for running and serving dynamic PHP applications on Arm-based machines.
9
+
## Install PHP
10
+
In this section, you’ll install PHP, the Apache web server, and several commonly used PHP extensions on a SUSE Arm-based virtual machine. This setup forms the foundation for running and serving dynamic PHP applications on Arm-based machines.
11
11
12
-
###Update the system
12
+
## Update the system
13
13
Before installing any software, make sure your system has the latest packages and security patches:
14
14
15
15
```console
16
16
sudo zypper refresh
17
17
sudo zypper update -y
18
18
```
19
19
20
-
###Install PHP, Apache, and common extensions
21
-
Now install PHP, PHP-FPM, Apache web server, and some commonly used PHP extensions by using the following command:
20
+
## Install PHP, Apache, and common extensions
21
+
Install PHP, PHP-FPM, Apache web server, and some commonly used PHP extensions by running:
with Zend OPcache v8.0.30, Copyright (c), by Zend Technologies
78
+
79
+
{{% notice success %}}
80
+
PHP is installed and ready for use on your Arm-based SUSE VM.
81
+
{{% /notice %}}
80
82
```
81
83
You can now proceed to the baseline testing section, where you’ll create and load a simple PHP web page to confirm that Apache and PHP are working together on your SUSE Arm-based virtual machine.
0 commit comments