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/background.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
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Getting started with PHP on Google Axion C4A (Arm Neoverse-V2)
2
+
title: Get started with PHP on Google Axion C4A (Arm NeoverseV2)
3
3
4
4
weight: 2
5
5
@@ -8,7 +8,7 @@ layout: "learningpathall"
8
8
9
9
## Google Axion C4A Arm instances in Google Cloud
10
10
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
+
Google Axion C4A is a family of Arm-based virtual machines built on Google’s custom Axion CPU, which is based on Arm NeoverseV2 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.
12
12
13
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.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/php-on-gcp/baseline.md
+78-24Lines changed: 78 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,75 +8,127 @@ layout: learningpathall
8
8
9
9
10
10
## Baseline Setup for PHP-FPM
11
-
This section covers the installation and configuration of **PHP and Apache**on a SUSE Arm-based GCP VM. It includes setting up **PHP-FPM** with a Unix socket, verifying PHP functionality via a test page, and ensuring Apache and PHP-FPM work together correctly.
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.
12
12
13
13
### Configure the PHP-FPM Pool
14
14
15
-
**PHP-FPM:** A FastCGI Process Manager that runs PHP scripts efficiently, handling multiple requests separately from the web server for better performance and security.
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.
16
17
17
-
A **pool** is basically a set of PHP worker processes that handle requests.
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.
18
19
19
20
### Copy the Default Configuration (if missing)
20
21
21
-
Run this command to create a working config file:
22
+
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. |
58
+
| listen.owner = wwwrun | Sets the owner of the socket file to `wwwrun`, which is the default user that Apache runs as on SUSE systems. This ensures Apache has access to the socket. |
59
+
| listen.group = www | Assigns the group ownership of the socket to `www`, aligning with Apache’s default process group for proper access control. |
60
+
| 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. |
61
+
49
62
50
63
### Start and Enable PHP-FPM
51
64
52
-
Restart PHP-FPM so it picks up the changes:
65
+
After updating the configuration, restart the PHP-FPM service so it picks up the new settings:
53
66
54
67
```console
55
68
sudo systemctl restart php-fpm
56
69
```
70
+
Then, verify that PHP-FPM is running:
71
+
72
+
```console
73
+
sudo systemctl status php-fpm
74
+
```
75
+
76
+
You should see output similar to:
77
+
78
+
```output
79
+
● php-fpm.service - The PHP FastCGI Process Manager
Oct 16 13:56:44 pareena-php-test systemd[1]: Starting The PHP FastCGI Process Manager...
92
+
Oct 16 13:56:44 pareena-php-test systemd[1]: Started The PHP FastCGI Process Manager.
93
+
```
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.
96
+
97
+
## 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:
99
+
100
+
```console
101
+
sudo zypper install apache2-mod_php8
102
+
```
103
+
Once the module is installed, restart Apache to load the new configuration:
104
+
105
+
```console
106
+
sudo systemctl restart apache2
107
+
```
108
+
Next, you will test PHP execution by creating a simple PHP page and verifying that Apache can correctly render dynamic content.
57
109
58
110
## Test PHP
59
-
Now that PHP and Apache are installed, let’s verify that everything is working correctly.
111
+
Now that PHP and Apache are installed, you can verify that everything is working correctly.
60
112
61
113
### Create a Test Page
62
-
We will make a simple PHP file that shows details about the PHP setup.
114
+
Create a simple PHP file that displays detailed information about your PHP installation:
63
115
64
116
```console
65
117
echo "<?php phpinfo(); ?>" | sudo tee /srv/www/htdocs/info.php
66
118
```
67
-
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.
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.
68
120
69
121
### Test from Inside the VM
70
-
Run the following command:
122
+
You can verify that PHP and Apache are communicating correctly by testing the web server locally using curl:
71
123
72
124
```console
73
125
curl http://localhost/info.php
74
126
```
75
127
-`curl` fetches the page from the local Apache server.
76
-
- If PHP is working, you’ll see a large block of HTML code as output.
77
-
- This confirms that PHP is correctly connected with Apache.
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.
78
130
79
-
You should see an output similar to:
131
+
You should see output similar to:
80
132
81
133
```output
82
134
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
Basically, it is the HTML output that confirms PHP is working.
151
+
This long HTML output represents the PHP configuration page content.
100
152
101
153
### Test from Your Browser
102
-
Now, let’s test it from outside the VM. Open a web browser on your local machine (Chrome, Firefox, Edge, etc.) and enter the following URL in the address bar:
154
+
Now, let's verify that your PHP setup works correctly from outside the VM.
155
+
Open a web browser on your local machine (such as Chrome, Firefox, or Edge) and enter the following URL in the address bar:
103
156
104
157
```console
105
158
http://<YOUR_VM_PUBLIC_IP>/info.php
106
159
```
107
-
- Replace `<YOUR_VM_PUBLIC_IP>` with the public IP of your GCP VM.
160
+
- Replace `<YOUR_VM_PUBLIC_IP>` with the public IP of your Google Cloud Axion VM.
108
161
109
162
If everything is set up correctly, you will see a PHP Info page in your browser. It looks like this:
This verifies the basic functionality of the PHP installation before proceeding to the benchmarking.
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.
0 commit comments