{"id":4599,"date":"2026-08-23T09:25:05","date_gmt":"2026-08-23T09:25:05","guid":{"rendered":"https:\/\/ownwebservers.com\/kb\/?p=4599"},"modified":"2026-08-23T09:25:05","modified_gmt":"2026-08-23T09:25:05","slug":"change-php-version-ssh-shared-hosting","status":"publish","type":"post","link":"https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/","title":{"rendered":"How to Use SSH on Shared Hosting Plans to Change PHP Version"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">When managing a website, you often need to juggle multiple tools, scripts, and frameworks that require different PHP versions. While most hosting control panels make it easy to change the PHP version for your website, handling that same version through a command-line interface can be less intuitive. If you&#8217;re running scheduled tasks, testing custom scripts, or managing deployments, you need your command-line environment to match your web environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For small business owners managing their own infrastructure, tapping into your server via SSH saves time. Instead of navigating a graphical interface every time you need to run a quick command, you can handle it directly from the terminal. Here&#8217;s how to safely and effectively change your PHP version via SSH on shared hosting plans.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Enabling SSH Access on Shared Hosting Plans<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before you can run any commands, you&#8217;ll want to make sure your hosting account actually has SSH access enabled. On shared hosting, SSH is sometimes disabled by default for security reasons. Modern shared hosting environments provide multi-PHP support, but access to the command line must usually be explicitly activated via your control panel.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Locating SSH Access Features in the Hosting Control Panel<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Log into your cPanel (or equivalent hosting dashboard) and look for the &#8220;SSH Access&#8221; or &#8220;Terminal&#8221; icon. If you&#8217;re using cPanel, you&#8217;ll often find a built-in terminal right in the dashboard, which requires no additional setup. If you prefer using an external client like PuTTY or macOS Terminal, you&#8217;ll need to ensure your IP address is whitelisted and your SSH credentials are active.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Generating and Registering SSH Keys for Authentication<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For a secure connection, password authentication is acceptable, but SSH keys are much safer. From your local terminal, you can generate a key pair using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh-keygen -t ed25519 -C \"your_email@example.com\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once generated, you&#8217;ll need to upload the public key (<code>id_ed25519.pub<\/code>) to your hosting control panel under the SSH Access section. This registers your local machine as a trusted client, allowing you to log in without typing your account password each time.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Understanding PHP CLI Execution vs. Web Server PHP<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A common stumbling block for server administrators is realizing that the PHP version serving your website does not automatically dictate the PHP version used when you type <code>php<\/code> in SSH. These are two separate execution environments.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The Distinction Between MultiPHP Manager Web Settings and CLI Binaries<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When you use the MultiPHP Manager in cPanel to set your domain to PHP 8.1, you&#8217;re telling the web server (Apache or LiteSpeed) which interpreter to use for HTTP requests. However, your SSH session relies on the system&#8217;s command-line interface (CLI) binary path. Sometimes these are synchronized, but often they drift, meaning running a Composer install or a custom cron job might execute under an older PHP version like 7.4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Verifying the Active CLI PHP Version with php -v<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To see exactly what your command line is currently using, simply run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php -v<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will output the active CLI PHP version and should be run immediately after modifying any environment variables or shell profiles to confirm your changes took effect.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Executing PHP Scripts via Specific Versions in SSH<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you only need to run a specific script under a newer PHP version without changing your global CLI configuration, you can bypass the default version entirely.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Using cPanel cpcli for Synchronized CLI and Web PHP Versions<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In cPanel environments, the <code>cpcli<\/code> utility is incredibly helpful. It allows you to run PHP scripts from the command line using the exact PHP version configured for that specific domain in MultiPHP Manager. This ensures synchronization across both web and CLI environments. You can typically use it like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cpcli php \/home\/username\/script.php<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Calling Direct PHP Binaries Using Absolute Paths<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If <code>cpcli<\/code> is unavailable or you want targeted version execution, administrators use absolute binary paths. Most modern shared servers store multiple PHP versions in specific directories. For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/remi\/php81\/root\/usr\/bin\/php \/home\/username\/script.php<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For cPanel servers using EasyApache 4, the paths look slightly different but follow the same structure:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/cpanel\/ea-php81\/root\/usr\/bin\/php \/home\/username\/script.php<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This forces the script to run under PHP 8.1 regardless of what the default <code>php<\/code> command is symlinked to.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Overriding the Default PHP CLI Version via Shell Profiles<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you frequently use the command line and don&#8217;t want to type out absolute paths every single time, you can modify your shell profile to change the default PHP version for your user session.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Configuring PHP Version Aliases in .bashrc<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If your shared hosting platform supports a <code>.bashrc<\/code> profile, you can create an alias for the PHP version you prefer. First, verify the exact path of the PHP binary you want to use. Then, edit your <code>.bashrc<\/code> file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano ~\/.bashrc<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add the following line to create a shortcut that overrides the default binary path:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>alias php='\/usr\/local\/bin\/php81'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Be sure to replace the path with the actual absolute path for the PHP version on your specific server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Reloading Shell Profiles and Validating the New Default Version<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The alias won&#8217;t take effect in your current session immediately. You must reload the shell profile by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>source ~\/.bashrc<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;p&#8221;Now, run <code>php -v<\/code> again. It should now report the new version you assigned.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Managing php.ini Settings Without Root Access<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;p-Changing the PHP version is only half the battle; configuration settings like memory limits and execution times are equally important. On a shared server, you don&#8217;t have root access.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Shared Hosting Restrictions on Global php.ini Modifications<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You cannot alter the global <code>php.ini<\/code> file via SSH because it affects every user on the shared server. Attempting to edit it will result in a permission denied error. Configuration changes must be made using the INI editor in the hosting control panel.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Applying Local php.ini Files for Directory-Specific Configuration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you need specific settings for a single application or directory, you can create a local <code>php.ini<\/code> file in that directory via SSH:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/home\/username\/public_html\/app\/php.ini<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add your custom directives here, such as <code>memory_limit = 256M<\/code>. Note that on some servers running PHP-FPM or LiteSpeed, local <code>php.ini<\/code> files are ignored, and you must use <code>.user.ini<\/code> instead. If your changes aren&#8217;t taking effect, try renaming the file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv php.ini .user.ini<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting Common SSH PHP Issues<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">            &lt;td_USE_the_absolute_path (e.g., <code>\/opt\/cpanel\/ea-php81\/root\/usr\/bin\/php<\/code>) or add an alias in your <code>.bashrc<\/code> file.\n<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Symptom<\/th><th>Cause<\/th><th>Fix<\/th><\/tr><\/thead><tbody><tr><td><code>-bash: php: command not found<\/code><\/td><td>The PHP binary is not in your user&#8217;s PATH environment variable.<\/td><\/tr><tr><td><code>Editphp.ini results in permission denied error.<\/code><\/td><td>You&#8217;re trying to edit global server configuration without root privileges.<\/td><td>Create_a_local_<code>.user.ini file in_your web directory instead.<\/code><\/td><\/tr><tr><td>Cron jobs run an older PHP version despite .bashrc alias.<\/td><td>Cron doesn&#8217;t load user shell profiles automatically.<\/td><td>Edit_your_crontab_and_replace_&#8217;php&#8217;_with_the_full_absolute_path (e.g., \/opt\/cpanel\/ea-php81\/root\/usr\/bin\/php).<\/td><\/tr><tr><td><\/td><td>Your hosting provider doesn&#8217;t include cPanel&#8217;s cpcli utility or uses an alternative control panel.<\/td><td>Rely_on_direct_binary_execution_using_absolute_paths_from_\/opt\/cpanel\/ea-phpXX\/root\/usr\/bin\/php.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting Common Issues <\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">            &lt; USe_the_absolute_path_(e .g ., _\/opt\/cpanel\/ea-php80\/root\/usr\/bin\/php )_or_add_an_alias_in_your_.bashrc_file . \n\n            Edithttps : \/\/ permission denied error when editing php .ini<br>\n            td &gt;You &#8216;re trying_to_edit_global_server_configuration_without_root_privileges . \/ td &gt;<br>\n                td &gt; Create_a_local_.user .ini_file_in_your_web_directory_instead . \/ td &gt;<br>\n        \/ tr &gt;<br>\n        Cron jobs_run_an_older_PHP_version_despite_.bashrc_alias .<br>\n        td &gt; Cron_doesn &#8216;t_load_user_shell_profiles_automatically .\/ td &gt;<br>\n Edit_your_crontab_and_replace_&#8217;php&#8217;_with_the_full_absolute_path_(e .g ., _\/opt\/cpanel\/ea-php81\/root\/usr\/bin\/php )._ fj<br>\n ) cpcli : _command_not_found<br>\n td &gt; Your_hosting_provider_doesn &#8216;t_include_cPanel &#8216;s_cpcli_utility_or_uses_an_alternative_control_panel .\/ td &gt;<br>\n Rely_on_direct_binary_execution_using_absolute_paths_from_\/opt\/cpanel\/ea-phpXX\/root\/usr\/bin\/php .\/ td &gt;<br>\n    \/ tr &gt;<br>\n\/tbody &gt;<br>\n\/ table &gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Best_Practices_for_Managing_PHP_via_SSH <!-- h2 --><p><\/p>\n<ul>\n   ch li &gt;<strong> Synchronize_Web_and_CLI_Versions : \/\/ strong &gt;\/ li &gt; Whenever_you_update_MultiPHP_Manager_in_cPanel , _verify_your_CLI_version_matches_to_prevent_deployment_errors_with_tools_like_Composer_or_Drush . \/ li &gt;<br>\n   ch li &gt;<strong> Avoid_EOL_Versions : \/\/ strong &gt;\/ li &gt; Always_check_the_official_PHP_supported_versions_list .\/ Running_an_End &#8211; of &#8211; Life_version_leaves_your_business_vulnerable_to_script_execution_vulnerabilities_and_data_breaches .\/ li &gt;<br>\n   Absolut<br>\nfh2&gt;Frequently_Asked_Questions\/h2<p><\/p>\n<div class=\"wpcwp-faq\">\n<details class=\"wpcwp-faq-item\">\n<summary>Does_changing_the_PHP_version_in_cPanel &#8216;s_MultiPHP_Manager_affect_my_SSH_command_line_(CLI )_version ?\/\/ summary \/<p><\/p>\n<div class=\"wpcwp-faq-answer\">In_many_cPanel_environments , _selecting_a_PHP_version_in_MultiPHP_Manager_synchronizes_the_web_server_and_the_default_CLI_PHP_versions .\/ However , _this_depends_on_your_host &#8216;s_specific_configuration .\/ You_should_always_verify_your_active_CLI_version_using_the_&#8217;php_-v &#8216;_command_after_making_changes_in_the_control_panel .\/ div &gt;<br>\n\/details \/<p><\/p>\n<details class=\"wpcwp-faq-item\">\n<summary>How_can_I_run_a_specific_PHP_script_with_a_different_PHP_version_without_changing_my_global_CLI_default ?\/\/ summary \/<p><\/p>\n<div class=\"wpcwp-faq-answer\">You_can_execute_a_specific_PHP_version_directly_by_calling_its_absolute_binary_path_from_the_command_line .\/ For_example , _instead_of_typing_&#8217;php_script .php &#8216;, _you_would_use_a_path_like_&#8217;\/opt\/remi\/php81\/root\/usr\/bin\/php_script .php &#8216;_to_force_execution_with_PHP_8 .\/ div &gt;<br>\n\/details \/<p><\/p>\n<details class=\"wpcwp-faq-item\">\n<summary>Can_I_permanently_change_my_default_SSH_PHP_version_using_my_shell_profile ?\/\/ summary \/<p><\/p>\n<div class=\"wpcwp-faq-answer\">Yes , _if_your_hosting_provider_allows_it , _you_can_override_the_default_PHP_binary_by_adding_an_alias_to_your_&#8217; .bashrc &#8216;_file_(e ._g ., _alias_php = &#8216;\/usr\/local\/bin\/php81 &#8216;)._After_saving_the_file , _reload_your_shell_profile_for_the_changes_to_take_effect .\/ div &gt;<br>\n\/details \/<p><\/p>\n<details class=\"wpcwp-faq-item\">\n<summary>Why_can &#8216;t_I_edit_the_global_php .ini_file_directly_via_SSH_on_a_shared_hosting_plan ?\/\/ summary \/<p><\/p>\n<div class=\"wpcwp-faq-answer\">Shared_hosting_environments_restrict_global_php .ini_modifications_to_prevent_one_user &#8216;s_settings_from_affecting_all_other_accounts_on_the_server .\/ To_customize_PHP_settings , _you_must_use_the_hosting_control_panel &#8216;s_INI_editor_or_upload_a_local_php .ini_file_to_the_specific_directory_requiring_custom_configuration .\/ div &gt;<br>\n\/details \/<p><\/p>\n<details class=\"wpcwp-faq-item\">\n<summary>What_are_the_security_risks_of_running_an_End &#8211; of &#8211; Life_(EOL )_PHP_version_via_CLI ?\/\/ summary \/<p><\/p>\n<div class=\"wpcwp-faq-answer\">EOL_PHP_versions_no_longer_receive_security_patches , _making_them_highly_vulnerable_to_exploits_and_script_execution_vulnerabilities .\/ Updating_to_a_supported , _actively_maintained_PHP_version_is_critical_for_securing_your_applications_and_preventing_server_compromise .\/ div &gt;<br>\n\/details \/<p><\/p>\n<details class=\"wpcwp-faq-item\">\n<summary>Do_all_shared_hosting_plans_come_with_SSH_access_enabled_by_default ?\/\/ summary \/<p><\/p>\n<div class=\"wpcwp-faq-answer\">No , _many_entry &#8211; level_shared_hosting_plans_disable_SSH_access_by_default_for_security_reasons_or_require_you_to_explicitly_enable_it .\/ You_typically_need_to_generate_and_register_SSH_keys_through_your_hosting_control_panel_before_you_can_connect_securely .\/ div &gt;<br>\n\/details &gt;<p><\/p>\n<h2>Related reading<\/h2>\n<ul>\n<li><a href=\"https:\/\/ownwebservers.com\/kb\/add-txt-dns-record-cpanel\/\">How to Add a TXT DNS Record in cPanel for Verification and Email Authentication<\/a><\/li>\n<li><a href=\"https:\/\/ownwebservers.com\/kb\/wordpress-discussion-settings-performance-security\/\">Optimizing WordPress Discussion Settings for Performance and Security<\/a><\/li>\n<li><a href=\"https:\/\/ownwebservers.com\/kb\/add-widget-wordpress-sidebar\/\">How to Add a Widget to the WordPress Sidebar: A Complete Technical Guide<\/a><\/li>\n<li><a href=\"https:\/\/ownwebservers.com\/kb\/restore-files-folders-cpanel-backup-restore-tool\/\">How To Restore Files and Folders Using the cPanel Backup Restore Tool<\/a><\/li>\n<\/ul><\/div><\/summary><\/details><\/div><\/summary><\/details><\/div><\/summary><\/details><\/div><\/summary><\/details><\/div><\/summary><\/details><\/div><\/summary><\/details><\/div><\/strong><\/strong><\/ul><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Symptom <\/th><th>Cause <\/th><th>Fix <\/th><\/tr><\/thead><tbody><tr><td><\/td><td>The PHP binary is not in_your_user&#8217;s_PATH_environment_variable .<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to change the PHP version via SSH on shared hosting. Discover how to use cpcli, absolute paths, and .bashrc aliases for secure PHP CLI execution.<\/p>\n","protected":false},"author":1,"featured_media":4602,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"new-technologies","meta":{"footnotes":""},"categories":[24],"tags":[288,67,86,180,289,287,286],"class_list":["post-4599","post","type-post","status-publish","format-new-technologies","has-post-thumbnail","hentry","category-web-hosting","tag-cli","tag-cpanel","tag-php","tag-security","tag-server-configuration","tag-shared-hosting","tag-ssh","post_format-new-technologies"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Change PHP Version via SSH on Shared Hosting<\/title>\n<meta name=\"description\" content=\"Learn how to change the PHP version via SSH on shared hosting. Discover how to use cpcli, absolute paths, and .bashrc aliases for secure PHP CLI execution.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Change PHP Version via SSH on Shared Hosting\" \/>\n<meta property=\"og:description\" content=\"A comprehensive guide to changing and executing specific PHP versions via SSH on shared hosting plans using cPanel, direct binaries, and shell profiles.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/\" \/>\n<meta property=\"og:site_name\" content=\"OWS KB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/OWN-WEB-SERVERS-107052961577434\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-23T09:25:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2026\/08\/pexels-photo-17489158.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1880\" \/>\n\t<meta property=\"og:image:height\" content=\"1255\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:description\" content=\"Master PHP CLI execution on shared hosting. Learn how to change PHP versions via SSH, configure .bashrc aliases, and manage EOL PHP security risks.\" \/>\n<meta name=\"twitter:creator\" content=\"@OwnWebservers\" \/>\n<meta name=\"twitter:site\" content=\"@OwnWebservers\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/change-php-version-ssh-shared-hosting\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/change-php-version-ssh-shared-hosting\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#\\\/schema\\\/person\\\/4a40fe3fe17a08ddd1d7c113668e75f2\"},\"headline\":\"How to Use SSH on Shared Hosting Plans to Change PHP Version\",\"datePublished\":\"2026-08-23T09:25:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/change-php-version-ssh-shared-hosting\\\/\"},\"wordCount\":1812,\"publisher\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/change-php-version-ssh-shared-hosting\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/pexels-photo-17489158.jpeg\",\"keywords\":[\"CLI\",\"cPanel\",\"PHP\",\"security\",\"Server Configuration\",\"Shared Hosting\",\"SSH\"],\"articleSection\":[\"Web Hosting\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/change-php-version-ssh-shared-hosting\\\/\",\"url\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/change-php-version-ssh-shared-hosting\\\/\",\"name\":\"Change PHP Version via SSH on Shared Hosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/change-php-version-ssh-shared-hosting\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/change-php-version-ssh-shared-hosting\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/pexels-photo-17489158.jpeg\",\"datePublished\":\"2026-08-23T09:25:05+00:00\",\"description\":\"Learn how to change the PHP version via SSH on shared hosting. Discover how to use cpcli, absolute paths, and .bashrc aliases for secure PHP CLI execution.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/change-php-version-ssh-shared-hosting\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/change-php-version-ssh-shared-hosting\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/change-php-version-ssh-shared-hosting\\\/#primaryimage\",\"url\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/pexels-photo-17489158.jpeg\",\"contentUrl\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/pexels-photo-17489158.jpeg\",\"width\":1880,\"height\":1255,\"caption\":\"Photo by panumas nikhomkhai on Pexels\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/change-php-version-ssh-shared-hosting\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use SSH on Shared Hosting Plans to Change PHP Version\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/\",\"name\":\"OWS KB\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#organization\",\"name\":\"Own Web Servers\",\"url\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/OWS-Logo-with-punchline-front-scaled.png\",\"contentUrl\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/OWS-Logo-with-punchline-front-scaled.png\",\"width\":2560,\"height\":994,\"caption\":\"Own Web Servers\"},\"image\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/OWN-WEB-SERVERS-107052961577434\",\"https:\\\/\\\/x.com\\\/OwnWebservers\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#\\\/schema\\\/person\\\/4a40fe3fe17a08ddd1d7c113668e75f2\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\\\/\\\/ownwebservers.com\\\/kb\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Change PHP Version via SSH on Shared Hosting","description":"Learn how to change the PHP version via SSH on shared hosting. Discover how to use cpcli, absolute paths, and .bashrc aliases for secure PHP CLI execution.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/","og_locale":"en_US","og_type":"article","og_title":"Change PHP Version via SSH on Shared Hosting","og_description":"A comprehensive guide to changing and executing specific PHP versions via SSH on shared hosting plans using cPanel, direct binaries, and shell profiles.","og_url":"https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/","og_site_name":"OWS KB","article_publisher":"https:\/\/www.facebook.com\/OWN-WEB-SERVERS-107052961577434","article_published_time":"2026-08-23T09:25:05+00:00","og_image":[{"width":1880,"height":1255,"url":"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2026\/08\/pexels-photo-17489158.jpeg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_description":"Master PHP CLI execution on shared hosting. Learn how to change PHP versions via SSH, configure .bashrc aliases, and manage EOL PHP security risks.","twitter_creator":"@OwnWebservers","twitter_site":"@OwnWebservers","twitter_misc":{"Written by":"admin","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/#article","isPartOf":{"@id":"https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/"},"author":{"name":"admin","@id":"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2"},"headline":"How to Use SSH on Shared Hosting Plans to Change PHP Version","datePublished":"2026-08-23T09:25:05+00:00","mainEntityOfPage":{"@id":"https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/"},"wordCount":1812,"publisher":{"@id":"https:\/\/ownwebservers.com\/kb\/#organization"},"image":{"@id":"https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/#primaryimage"},"thumbnailUrl":"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2026\/08\/pexels-photo-17489158.jpeg","keywords":["CLI","cPanel","PHP","security","Server Configuration","Shared Hosting","SSH"],"articleSection":["Web Hosting"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/","url":"https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/","name":"Change PHP Version via SSH on Shared Hosting","isPartOf":{"@id":"https:\/\/ownwebservers.com\/kb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/#primaryimage"},"image":{"@id":"https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/#primaryimage"},"thumbnailUrl":"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2026\/08\/pexels-photo-17489158.jpeg","datePublished":"2026-08-23T09:25:05+00:00","description":"Learn how to change the PHP version via SSH on shared hosting. Discover how to use cpcli, absolute paths, and .bashrc aliases for secure PHP CLI execution.","breadcrumb":{"@id":"https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/#primaryimage","url":"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2026\/08\/pexels-photo-17489158.jpeg","contentUrl":"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2026\/08\/pexels-photo-17489158.jpeg","width":1880,"height":1255,"caption":"Photo by panumas nikhomkhai on Pexels"},{"@type":"BreadcrumbList","@id":"https:\/\/ownwebservers.com\/kb\/change-php-version-ssh-shared-hosting\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ownwebservers.com\/kb\/"},{"@type":"ListItem","position":2,"name":"How to Use SSH on Shared Hosting Plans to Change PHP Version"}]},{"@type":"WebSite","@id":"https:\/\/ownwebservers.com\/kb\/#website","url":"https:\/\/ownwebservers.com\/kb\/","name":"OWS KB","description":"","publisher":{"@id":"https:\/\/ownwebservers.com\/kb\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ownwebservers.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ownwebservers.com\/kb\/#organization","name":"Own Web Servers","url":"https:\/\/ownwebservers.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ownwebservers.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2026\/07\/OWS-Logo-with-punchline-front-scaled.png","contentUrl":"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2026\/07\/OWS-Logo-with-punchline-front-scaled.png","width":2560,"height":994,"caption":"Own Web Servers"},"image":{"@id":"https:\/\/ownwebservers.com\/kb\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/OWN-WEB-SERVERS-107052961577434","https:\/\/x.com\/OwnWebservers"]},{"@type":"Person","@id":"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/ownwebservers.com\/kb"]}]}},"_links":{"self":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/4599","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/comments?post=4599"}],"version-history":[{"count":2,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/4599\/revisions"}],"predecessor-version":[{"id":4604,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/4599\/revisions\/4604"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/media\/4602"}],"wp:attachment":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/media?parent=4599"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/categories?post=4599"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/tags?post=4599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}