How to resolve the issue “No such file or directory” in cPanel

February 14, 2024 / cPanel & WHM

This guide illustrates how to resolve the issue “No such file or directory” in cPanel. This error occurs while attempting to remove a NodeJS application through CloudLinux.

Let us discover the cause, reason of occurrence, and solution-

  • Cause –
    When attempting to uninstall the NodeJS application through cPanel’s Software section, the system displays the subsequent error message –ERROR: [Errno 2] No such file or directory: ‘/home/cptechs/public_html/app/.htaccess’
  • Reason –
    This error occurs when the application directory is deleted through the command line instead of being properly removed from the interface.
  • Solution –
    1. Reconstruct the deleted application directory by running the subsequent command –
      # mkdir -v /home/cptechs/public_html/app

      The example above assumes the application’s directory is /home/cptechs/public_html/app. Rearrange the directory path according to your application’s location, and then re-form the removed application.

    2. Create an empty .htaccess file in the directory –
      # touch /home/cptechs/public_html/app/.htaccess
    3. Change ownership of the recently created file to the suitable cPanel user –
      # chown cptechs:cptechs /home/cptechs/public_html/app/.htaccess

Hope you liked our article. We have a wide range of articles in our KB section, covering topics related to cPanel, Plesk, and WHM.

Dominos Search