WordPress Help Articles

View PHP Information

View PHP Information

How to Use

Download > Install > Activate. That’s it!

Example

Instantly view details about your PHP install without exposing a separate ‘live’ page with phpinfo() details and associated risks.

Source

This code can be pasted into the functions.php file of your child theme or, download and install the plugin for simple code activation.

function add_phpinfo_menu() {
    add_menu_page(
        'PHP Info',
        'PHP Info',
        'manage_options',
        'phpinfo-page',
        'display_phpinfo'
    );
}
add_action('admin_menu', 'add_phpinfo_menu');

function display_phpinfo() {
    if (!current_user_can('manage_options')) {
        wp_die(__('You do not have sufficient permissions to access this page.'));
    }
    echo '<div class="wrap">';
    ob_start();
    phpinfo();
    $phpinfo_content = ob_get_clean();
    echo $phpinfo_content;
    echo '</div>';
}

Via Webs Offers WordPress Hosting & Maintenance Services for Those That Prefer to Focus on Something Other Than the Technical Aspects

Our rollover development time lets you save unused hours for future assistance. Stay updated and optimized, with the flexibility to invest in new functionality.

Article Categories

Dive in to something specific you are wanting to learn more about.

Let's Get Started!