All Products
Search
Document Center

:Resolve the "no input file specified" error on an ECS website

Last Updated:Oct 30, 2025

Causes

This error typically occurs when the web server cannot find the specified PHP file or script. Possible causes include:

  • open_basedir restriction: Check the .user.ini file in the website's root directory to confirm that the open_basedir configuration includes the paths to all required directories.

  • Incorrect rewrite rule configuration: Check the rewrite (pseudo-static) rules in the website's configuration file to ensure requests are not misdirected to a non-existent PHP file.

  • Incorrect PHP handler configuration: Check the PHP runtime mode settings in the website's configuration file to ensure the web server passes requests to the PHP interpreter.

Solutions

Linux

The following steps use Alibaba Cloud Linux 3 as an example.

  1. Log on to the ECS instance.

    1. Go to ECS console - Instance. In the top navigation bar, select the target region and resource group.

    2. Go to the details page of the target instance. Click Connect and select Workbench. Follow the prompts on the page to log on to the terminal.

  2. Check for open_basedir restriction.

    1. In the website directory, check for the hidden .user.ini configuration file.

      sudo ls -la <website_directory>
      For example, if the website directory is /www/wwwroot/www.abc.com/, run sudo ls -la /www/wwwroot/www.abc.com/.
      • If the file exists, continue to the next step.

      • If the file does not exist, this restriction does not apply. Proceed to modify the configuration file.

    2. Check the open_basedir settings.

      In the .user.ini file, find the line that starts with open_basedir. Check if the directory list includes the full root path of the target website.

      For example, if the website directory is /www/wwwroot/www.abc.com but the .user.ini file contains open_basedir=/www/wwwroot/www.test.com/:/tmp/, add the missing path.
  3. Modify the configuration file.

    Apache

    1. Check and correct the .htaccess file.

      Go to the website's root directory and check for the .htaccess file. If it exists, ensure the RewriteRule line is configured as follows.

      This rule ensures that requests are redirected to index.php.
      RewriteRule ^(.*)$ /index.php?/$1 [L]
    2. Restart the Apache service.

      sudo systemctl restart httpd

    Nginx

    1. Check and correct the php.ini configuration.

      Edit the /etc/php.ini file and set the cgi.fix_pathinfo parameter to 1.

      The default value is 1. This setting lets the PHP interpreter find the correct file path, which improves compatibility.
    2. Check and correct the fastcgi.conf configuration.

      Edit the /etc/nginx/fastcgi.conf file and ensure that it contains the following configuration. This configuration ensures the web server passes requests to the PHP interpreter.

      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_param DOCUMENT_ROOT $document_root;
    3. Restart the Nginx service.

      sudo systemctl restart nginx
  4. Verify website access.

    After completing these steps, refresh website to confirm the issue is resolved.

Windows

The following steps use Windows Server 2022 with Internet Information Services (IIS) as an example.

  1. Log on to the ECS instance.

    1. Go to ECS console - Instance. In the top navigation bar, select the target region and resource group.

    2. Go to the details page of the target instance, click Connect, and select Workbench. Set the connection method to Terminal, enter the username and password, and then log on to the graphical terminal page.

  2. Check for open_basedir restrictions.

    1. Check if the .user.ini hidden configuration file exists in the website directory.

      In the File Explorer menu, click View and select the Hidden Items checkbox.

    2. Check the open_basedir settings.

      In the .user.ini file, find the line that starts with open_basedir. Check if the directory list includes the full root path of the target website.

      For example, if the website directory is C:\inetpub\wwwroot\mywebsite but the .user.ini file contains open_basedir = "C:\inetpub\wwwroot\abc", the path is incorrect and must be corrected.
  3. Check the PHP handler configuration for IIS.

    1. Edit the php.ini file.

      1. Comment out doc_root.

        Add a semicolon (;) at the beginning of the line containing the doc_root field to comment it out.image

      2. Modify cgi.force_redirect.

        Remove the semicolon (;) from the beginning of the line containin cgi.force_redirect = 1 and change its value to `0`. This change disables a security check, allowing PHP to run with IIS.image

    2. Restart the IIS service.

      Press Win+R, type PowerShell, and press Enter. In the PowerShell window, run the following command to restart the IIS service.

      iisreset /noforce
  4. Verify website access.

    After completing these steps, revisit your website to confirm the issue is resolved.