This error usually occurs when the PHP JSON extension is not enabled or your PHP environment is misconfigured. Follow these steps to resolve it.


Step 1: Enable the JSON Extension in cPanel

  1. Log into your cPanel.

  2. Scroll down to the Software section.

  3. Click Select PHP Version.

  4. Check your current PHP version. It should be 7.4 or higher, preferably 8.1 or 8.2.

    • If lower, change to PHP 8.1 or 8.2.

  5. In the extensions list, enable the following (tick the checkboxes):

    • json

    • mbstring

    • intl

    • pdo

    • openssl

    • fileinfo

    • tokenizer

  6. Click Save or Set as Current.


Step 2: Clear Laravel Cache Manually

Since you don’t have SSH access, clear the cache via cPanel:

  1. Open File Manager in cPanel.

  2. Navigate to your Laravel project directory (e.g., public_html/salepos/).

  3. Delete the contents (files inside) of these folders:

    • storage/framework/cache/

    • storage/framework/views/

    • bootstrap/cache/

  4. Refresh your website and check if the error persists.


Step 3: Use MultiPHP INI Editor to Enable JSON Extension

  1. In cPanel, go to MultiPHP INI Editor under the Software section.

  2. Select the PHP version your site is using.

  3. Make sure these directives are set (add if missing):

     
    extension=json memory_limit = 512M max_execution_time = 300 post_max_size = 128M upload_max_filesize = 128M
  4. Click Save.


Step 4: Reinstall PHP Dependencies Manually

Without SSH, you can manually refresh your Laravel dependencies:

  1. Open File Manager.

  2. Navigate to your Laravel installation folder (public_html/salepos/).

  3. Delete the vendor/ folder and composer.lock file.

  4. From a working environment, zip the vendor/ folder and upload it via File Manager.

  5. Extract the zip in your Laravel folder.


Step 5: Verify and Update .htaccess Settings

Sometimes LiteSpeed caching can interfere:

  1. In File Manager, open .htaccess in your Laravel root directory (public_html/salepos/).

  2. Add this line at the very top:

     
    AddHandler application/x-lsphp81 .php

    (Replace 81 with your actual PHP version if different.)


Final Checklist

  • ✅ PHP version is 7.4 or higher (preferably 8.1 or 8.2).

  • ✅ JSON extension is enabled via Select PHP Version.

  • ✅ Laravel cache cleared manually via File Manager.

  • ✅ PHP directives set via MultiPHP INI Editor.

  • vendor/ folder re-uploaded if needed.

  • .htaccess updated with LiteSpeed handler.


After these steps, refresh your site.

If issues persist, check your PHP error logs for more clues or contact your hosting support for assistance.

هل كانت المقالة مفيدة ؟ 0 أعضاء وجدوا هذه المقالة مفيدة (0 التصويتات)