PHP-JEXEC-001
defined('_JEXEC') or die;
defined('_JEXEC') or die;
This is not deprecated. Direct-hit PHP files without it are a security hole on every Joomla version. Do not delete it while “cleaning J3”.
defined('_JEXEC') or die; → Keep it on every entry PHP file
Symptoms people search
restricted access · _JEXEC
Replace this code
Swap defined('_JEXEC') or die; for Keep it on every entry PHP file.
Joomla 3
Remove or stop calling this
defined('_JEXEC') or die('Restricted access');Joomla 4 / 6
Use this instead
defined('_JEXEC') or die;How to fix it
- 1Keep _JEXEC on every web-reachable PHP file except the real entry points.
Also known as
_JEXEC · defined('_JEXEC') · Restricted access
Related issues
- Joomla 3 → 4PHP
jimport() autoloader calls
jimport('joomla.filesystem.file') → use Joomla\CMS\Filesystem\File;
- Joomla 3 → 4PHP
DS path constant
DS → DIRECTORY_SEPARATOR or /
- Joomla 3 → 4PHP
JPATH_PLATFORM
JPATH_PLATFORM → Do not use — autoload instead
- Joomla 5 → 6JavaScript
Assuming jQuery is always on the page
JHtml::_('jquery.framework') → Declare jQuery in joomla.asset.json only if you still need it
- Joomla 5 → 6JavaScript
Joomla.JText (JavaScript)
Joomla.JText._() → Joomla.Text._() + Text::script() in PHP
- Joomla 3 → 4PHP
mysql_* PHP functions
mysql_query() → Joomla DatabaseInterface / mysqli / PDO