The phpinfo() function is a built‑in PHP command that outputs detailed information about the PHP environment. On ruachost.com, you can use this function to check PHP configuration settings, extensions, and server details.

 

Why Use phpinfo()?

  • Verify which PHP version your site is running.

  • Check enabled extensions (e.g., MySQL, GD, cURL).

  • Review configuration options such as memory limits, upload sizes, and timeouts.

  • Troubleshoot compatibility issues with applications or frameworks.

 

How to Use phpinfo()

Step 1: Create a PHP File

  1. Log in to your hosting account via FTP, SFTP, or File Manager.

  2. Navigate to your site’s root directory (public_html).

  3. Create a new file named info.php.

Step 2: Add the phpinfo() Function

Insert the following code into the file:

<?php
phpinfo();
?>
 

Step 3: Upload and Access the File

  1. Save the file.

  2. Visit the file in your browser:

    http://yourdomain.com/info.php
    
  3. A page will display detailed PHP configuration information.

 

Security Warning

  • The phpinfo() output contains sensitive server details.

  • Do not leave the file accessible on a public site.

  • Delete or rename the file after testing.

 

Example Output

When you run phpinfo(), you’ll see information such as:

  • PHP version (e.g., 8.2.12)

  • Loaded extensions (e.g., mysqli, gd, intl)

  • Server API (e.g., Apache 2.0 Handler)

  • Configuration directives (e.g., memory_limit, upload_max_filesize)

這篇文章有幫助嗎? 0 用戶發現這個有用 (0 投票)

Powered by WHMCompleteSolution