DirectAdmin'de başka bir sorunu gidermek için CustomBuild ile her şeyi güncellediğimde Phalcon kurulumumu kaybettim ve aşağıdaki hatayı aldım:
Fatal error: Uncaught Error: Class "Phalcon\Mvc\Model" not found in /home/sikayetlerim/domains/sikayetlerim.com/public_html/public/index.php:5 Stack trace: #0 {main} thrown in /home/sikayetlerim/domains/sikayetlerim.com/public_html/public/index.php on line 5

Karşılaştığınız hata mesajı, PHP'nin betiği çalıştırırken Phalcon framework'üne ait olan Phalcon\Mvc\Model sınıfını bulamadığını gösteriyor. Bu durum genellikle Phalcon eklentisinin PHP yapılandırmanızda yüklü veya doğru biçimde etkin olmamasından kaynaklanır. Sorunu çözmek için izleyebileceğiniz adımlar aşağıdadır.
PHP 8.1 için AlmaLinux + DirectAdmin üzerinde Phalcon eklentisini etkinleştirmek üzere genel adımları takip edebilirsiniz. Süreç, DirectAdmin'in sunduğu PHP ve eklenti yönetim aracı CustomBuild'in kullanılmasını içerir.
Adım 1: Sunucuya Erişin
İlk olarak SSH üzerinden root kullanıcısı olarak sunucunuza giriş yapın. Sunucu IP adresinizi ve root şifrenizi kullanarak bir SSH istemcisi ile bağlanabilirsiniz.
Adım 2: CustomBuild Dizinine Gidin
Giriş yaptıktan sonra CustomBuild dizinine gidin. Bu dizin genellikle /usr/local/directadmin/custombuild altındadır ancak DirectAdmin kurulumunuza göre farklılık gösterebilir.
Code:
cd /usr/local/directadmin/custombuild
Adım 3: CustomBuild Betiklerini Güncelleyin
CustomBuild betiklerini güncellemek, en güncel yazılım ve eklenti sürümlerine sahip olmanızı sağlar.
Code:
./build update
Adım 4: PHP Seçeneklerini Yapılandırın
Phalcon'u kurmadan önce PHP yapılandırma ayarlarınızı kontrol etmek isteyebilirsiniz. PHP sürümlerini ve modlarını belirlemek için options.conf dosyasını kullanın.
Code:
nano options.conf
PHP sürüm ayarlarını arayın ve istediğiniz sürüme ayarlanmış olduğundan emin olun. Gerekirse diğer seçenekleri de yapılandırabilirsiniz.
Adım 5: Phalcon Eklentisini Kurun
PHP 8.1 için Phalcon kurmak için CustomBuild'in bu sürümü doğrudan desteklediğinden emin olmanız veya eklentiyi manuel olarak derlemeniz gerekebilir. CustomBuild Phalcon'u doğrudan destekliyorsa şu komutu kullanabilirsiniz:
Code:
./build phalcon
Aşağıdaki komutu da kullanabilirsiniz:
Code:
da build php_phalcon
Zaten yüklüyse şu komutla etkinleştirin:
Code:
da build set_php phalcon yes
DirectAdmin paneline gidin ve CustomBuild bölümünden Phalcon'u kurmak için yeni bir mesaj olduğunu göreceksiniz. Kurmak için "install" düğmesine tıklayın. Yaklaşık 10 dakika sürer.

When I tried to fix another problem in DirectAdmin and ran CustomBuild update_all, I lost my Phalcon installation and got the error below:
Fatal error: Uncaught Error: Class "Phalcon\Mvc\Model" not found in /home/sikayetlerim/domains/sikayetlerim.com/public_html/public/index.php:5 Stack trace: #0 {main} thrown in /home/sikayetlerim/domains/sikayetlerim.com/public_html/public/index.php on line 5

The error message you're encountering indicates that PHP is unable to find the Phalcon\Mvc\Model class, which is part of the Phalcon framework, when trying to execute your script. This typically happens because the Phalcon extension is not installed or properly enabled in your PHP configuration. Here are steps you can take to resolve this issue.
To enable the Phalcon extension on AlmaLinux with DirectAdmin for PHP version 8.1, you can follow these general steps. This process involves using CustomBuild, a tool provided by DirectAdmin for managing software packages, including PHP and its extensions.
Step 1: Access Your Server
First, log in to your server via SSH as the root user. You can do this by using an SSH client and entering your server's IP address and the root password.
Step 2: Navigate to the CustomBuild Directory
Once logged in, navigate to the CustomBuild directory. This is typically located in /usr/local/directadmin/custombuild, but the path might vary depending on your DirectAdmin installation.
Code:
cd /usr/local/directadmin/custombuild
Step 3: Update CustomBuild Scripts
It's a good practice to update the CustomBuild scripts to ensure you have the latest versions of the software and extensions available.
Code:
./build update
Step 4: Configure Options for PHP
Before installing Phalcon, you might want to check or update your PHP configuration settings. Use the options.conf file to specify the PHP versions and modes.
Code:
nano options.conf
Look for the PHP version settings and ensure they are set to your desired versions. You can also configure other options as needed.
Step 5: Install Phalcon Extension
To install Phalcon for PHP 8.1, you will need to ensure that CustomBuild supports it directly, or you may need to manually compile the extension. If CustomBuild supports installing Phalcon directly, you could use a command like:
Code:
./build phalcon
You can use the code below instead:
Code:
da build php_phalcon
If it's already installed, activate it with:
Code:
da build set_php phalcon yes
Go to DirectAdmin panel and CustomBuild section, you will see a new message to install Phalcon. Click install — it takes about 10 minutes.

Last edited: