mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-05-07 02:35:30 +02:00
Fix broken PHP symlink after upgrade: use lexists to detect dangling symlinks
os.path.exists() returns False for broken symlinks (e.g. /usr/bin/php pointing to removed php7.4), so the old link was never removed and the new ln -s to lsphp83 failed silently. Use os.path.lexists() instead.
This commit is contained in:
@@ -4846,8 +4846,8 @@ pm.max_spare_servers = 3
|
||||
Upgrade.stdOut('[ERROR] Failed to install PHP 8.3')
|
||||
return 0
|
||||
|
||||
# Remove existing PHP symlink if it exists
|
||||
if os.path.exists('/usr/bin/php'):
|
||||
# Remove existing PHP symlink if it exists (os.path.lexists catches broken symlinks too)
|
||||
if os.path.lexists('/usr/bin/php'):
|
||||
os.remove('/usr/bin/php')
|
||||
|
||||
# Create symlink to PHP 8.3
|
||||
|
||||
Reference in New Issue
Block a user