• Contact
  • About Me
  • Privacy Policy
DefenceDev
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
DefenceDev
No Result
View All Result
ADVERTISEMENT
Home Projects Nextcloud

Nextcloud: Solving Common PHP Issues on Ubuntu 22.04

neo by neo
May 27, 2025
in Nextcloud
0
Nextcloud: Solving Common PHP Issues on Ubuntu 22.04

Nextcloud: Solving Common PHP Issues on Ubuntu 22.04

0
SHARES
16
VIEWS
Share on FacebookShare on Twitter
ADVERTISEMENT

Introduction

In this article, I have collected different troubleshooting techniques for self-hosted Nextcloud installation on Ubuntu 22.04 Server. I had the most problems due to the PHP version. In this guide, we will dive into troubleshooting common PHP-related issues in Nextcloud,

Solving Common PHP Issues on Ubuntu 22.04

As a powerful self-hosted cloud solution, Nextcloud relies heavily on PHP for its server-side operations. Problems with PHP configurations, memory limits, and module compatibility can disrupt the smooth running of your Nextcloud instance. In this post, we’ll cover key PHP-related troubleshooting steps, including error log analysis, configuration tweaks, and performance optimization to ensure that your Nextcloud server runs without a hitch.

Check the PHP Version on Ubuntu 22.04 Server

Currently, my environment is running on PHP 8.2.

php -v

PHP 8.2.23 (cli) (built: Aug 30 2024 09:21:47) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.23, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.23, Copyright (c), by Zend Technologies

Uninstal PHP from Ubuntu 22.04 Server

With commands below, you will be able to remove PHP from your server:

# If PHP is installed using the apt package manager:
sudo apt-get purge php*

# If PHP is installed using aptitude:
sudo aptitude purge php*

# Remove PHP configuration files:

sudo rm -rf /etc/php/

# To remove dependencies or unnecessary packages,
sudo apt-get autoremove

Verify PHP removal:
dpkg -l | grep php

Install PHP 8.2 on Ubuntu 22.04 Server

To install or update your PHP at the server, you can copy the commands from below:

# Install
apt-get update && apt-get upgrade -y

add-apt-repository ppa:ondrej/php

apt install php8.2 -y

apt-get install -y php8.2-cli php8.2-common php8.2-fpm php8.2-mysql php8.2-zip php8.2-gd php8.2-mbstring php8.2-curl php8.2-xml php8.2-bcmath

IMPORTANT: PHP Version 8.3 is recommended by Nextcloud Homepage.

Check Current PHP Version / Disable Older PHP

Main PHP configuration file location is under:

  • PHP CLI: /etc/php/8.2/cli/php.ini
  • Apache: /etc/php/8.2/apache2/php.ini
# Check which version are installed and select correct PHP Version
update-alternatives --config phar.phar

There are 3 choices for the alternative phar.phar (providing /usr/bin/phar.phar).

  Selection    Path                        Priority   Status
------------------------------------------------------------
* 0            /usr/bin/phar.phar.default   100       auto mode
  1            /usr/bin/phar.phar.default   100       manual mode
  2            /usr/bin/phar.phar7.4        74        manual mode
  3            /usr/bin/phar.phar8.1        81        manual mode

Press <enter> to keep the current choice[*], or type selection number: ^C

# Disable all not needed PHP Version
a2dismod php8.0
a2dismod php7.4

# Enable installed PHP version
a2enmod php8.2 

# Restart web server
sudo systemctl restart apache2

List All the Installed PHP modules

Modules are stored under /etc/php/8.2/mods-available directory.

ADVERTISEMENT

PHP Active modules configuration directory location:

ADVERTISEMENT
ADVERTISEMENT
  • PHP CLI: /etc/php/8.2/cli/conf.d/
  • Apache: /etc/php/8.2/apache2/conf.d/

Nextcloud Talk Issue Related to the PHP

Nextcloud Talk issue is related to the php-intl package, which provides internationalization support for PHP applications.

To install this package, you need to follow the following steps:

# Stop services
sudo systemctl stop apache2
sudo systemctl stop mariadb.service

# Install the package
sudo apt install php-intl

# Start services
sudo systemctl start apache2
sudo systemctl start mariadb.service

Please check my other articles related to the Nextcloud:

  • NextCloud: Maintenance with OCC Command with Practical Examples
  • Nextcloud: My Experience Collected in 2 Years of Use

About The Author

neo

See author's posts

Tags: best-on-the-webnextcloud
ADVERTISEMENT
Previous Post

Linux Files Operation: mv, rm, cp (Rename, Remove and Copy Files and Directories)

Next Post

Linux Networking: netplan Network Configuration on Ubuntu

neo

neo

Next Post
Linux Networking: netplan Network Configuration on Ubuntu

Linux Networking: netplan Network Configuration on Ubuntu

Follow Us

  • Trending
  • Comments
  • Latest
MikroTik: Export Configuration in Text File

MikroTik: Export Configuration in Text File

Fortinet FortiGate: Static Route Configuration via GUI and CLI

Fortinet FortiGate: Static Route Configuration via GUI and CLI

Immich: Installation on Ubuntu 22.04

Immich: Installation on Ubuntu 22.04

Fortinet FortiGate Upgrade Path Tool

Fortinet FortiGate Upgrade Path Tool

NextCloud: Port Forwarding - Essential Ports for Smooth Functionality

NextCloud: Port Forwarding – Essential Ports for Smooth Functionality and Remote Access

Organizing and Managing Photos with Immich: Features I Use

Organizing and Managing Photos with Immich: Features I Use

Install Ubuntu 22.04 on Oracle VM Virtual Box

Install Ubuntu 22.04 on Oracle VM Virtual Box

Linux Directories: cd (Change Directory), pwd (Print Working Directory), mkdir (Make Directory)

Linux Directories: cd (Change Directory), pwd (Print Working Directory), mkdir (Make Directory)

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Recent News

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

MikroTik: Check Your Wireless Password

MikroTik: Check Your Wireless Password

ADVERTISEMENT

DefenceDev Tutorials

defencedev Logo

Whether you’re just starting or looking to expand your skills, I hope you find useful information and engaging discussions here. Let me take you through my journey and the goals behind this space!

Follow Us

Browse by Category

  • Blog
  • Cloud
    • Private
  • Linux Tutorials
    • Bash Scripting Tutorials
    • Commands
    • Networking
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Solutions
    • Docker
  • Video Tutorials
    • MikroTik Videos

Recent News

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

  • Site Map
  • Privacy Policy
  • Facebook Page
  • Disclaimer
  • Contact
  • About Me

© 2025 defencedev.com - All rights reserved.

No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos

© 2025 defencedev.com - All rights reserved.