Deprecated: WP_Translation_Controller::load_file(): Implicitly marking parameter $locale as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-includes/l10n/class-wp-translation-controller.php on line 101
Deprecated: WP_Translation_Controller::unload_file(): Implicitly marking parameter $locale as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-includes/l10n/class-wp-translation-controller.php on line 156
Deprecated: WP_Translation_Controller::unload_textdomain(): Implicitly marking parameter $locale as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-includes/l10n/class-wp-translation-controller.php on line 201
Deprecated: WP_Translation_Controller::is_textdomain_loaded(): Implicitly marking parameter $locale as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-includes/l10n/class-wp-translation-controller.php on line 243
Deprecated: WP_Translation_Controller::translate(): Implicitly marking parameter $locale as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-includes/l10n/class-wp-translation-controller.php on line 263
Deprecated: WP_Translation_Controller::translate_plural(): Implicitly marking parameter $locale as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-includes/l10n/class-wp-translation-controller.php on line 297
Deprecated: WP_Translation_Controller::locate_translation(): Implicitly marking parameter $locale as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-includes/l10n/class-wp-translation-controller.php on line 397
Deprecated: WP_Translation_Controller::get_files(): Implicitly marking parameter $locale as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-includes/l10n/class-wp-translation-controller.php on line 430
Deprecated: WP_Translation_File::create(): Implicitly marking parameter $filetype as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-includes/l10n/class-wp-translation-file.php on line 84
Deprecated: wp_getimagesize(): Implicitly marking parameter $image_info as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-includes/media.php on line 5502
Deprecated: YoastSEO_Vendor\Symfony\Component\DependencyInjection\Container::__construct(): Implicitly marking parameter $parameterBag as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-content/plugins/wordpress-seo/vendor_prefixed/symfony/dependency-injection/Container.php on line 60
Deprecated: Elementor\Controls_Stack::get_active_controls(): Implicitly marking parameter $controls as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-content/plugins/elementor/includes/base/controls-stack.php on line 352
Deprecated: Elementor\Controls_Stack::get_active_controls(): Implicitly marking parameter $settings as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-content/plugins/elementor/includes/base/controls-stack.php on line 352
Deprecated: Elementor\Controls_Stack::get_style_controls(): Implicitly marking parameter $controls as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-content/plugins/elementor/includes/base/controls-stack.php on line 799
Deprecated: Elementor\Controls_Stack::get_style_controls(): Implicitly marking parameter $settings as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-content/plugins/elementor/includes/base/controls-stack.php on line 799
Deprecated: Elementor\Elements_Manager::create_element_instance(): Implicitly marking parameter $element_type as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-content/plugins/elementor/includes/managers/elements.php on line 70
Deprecated: Elementor\Element_Base::__construct(): Implicitly marking parameter $args as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-content/plugins/elementor/includes/base/element-base.php on line 1563
Deprecated: Elementor\Repeater::__construct(): Implicitly marking parameter $args as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-content/plugins/elementor/includes/elements/repeater.php on line 49
Deprecated: Elementor\Core\Utils\Collection::filter(): Implicitly marking parameter $callback as nullable is deprecated, the explicit nullable type must be used instead in /home/cptech/public_html/wp-content/plugins/elementor/core/utils/collection.php on line 43
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /home/cptech/public_html/wp-includes/class-wp-theme-json.php on line 2532
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /home/cptech/public_html/wp-includes/class-wp-theme-json.php on line 2532
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /home/cptech/public_html/wp-includes/class-wp-theme-json.php on line 2532
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /home/cptech/public_html/wp-includes/class-wp-theme-json.php on line 2532
What are the safe permissions for files and folders in cPanel - A cPanel Tech
You are here: Home/cPanel/ Safe permissions for files and folders in cPanel
Warning: Cannot use bool as array in /home/cptech/public_html/wp-content/themes/genesis/lib/functions/image.php on line 104
Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home/cptech/public_html/wp-content/themes/genesis/lib/functions/image.php on line 116
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /home/cptech/public_html/wp-includes/class-wp-block-type-registry.php on line 168
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /home/cptech/public_html/wp-includes/class-wp-block-type-registry.php on line 168
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /home/cptech/public_html/wp-includes/class-wp-block-type-registry.php on line 168
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /home/cptech/public_html/wp-includes/class-wp-block-type-registry.php on line 168
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /home/cptech/public_html/wp-includes/class-wp-block-type-registry.php on line 168
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /home/cptech/public_html/wp-includes/class-wp-block.php on line 246
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /home/cptech/public_html/wp-includes/class-wp-block-type-registry.php on line 168
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /home/cptech/public_html/wp-includes/class-wp-block-type-registry.php on line 168
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /home/cptech/public_html/wp-includes/class-wp-block-type-registry.php on line 168
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /home/cptech/public_html/wp-includes/class-wp-block-type-registry.php on line 168
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /home/cptech/public_html/wp-includes/class-wp-block-type-registry.php on line 168
The folder permissions and ownership is one key to the security of the websites and your codes. You have to keep them safe so that any hacker wont deface your websites or inject malware. These happens because of two reasons
Usage of weak passwords –
I cannot stress more on using ultra strong passwords for your accounts, cPanel, eMail accounts, database etc and they must all be unique. If the password is weak and some one gets in, it is your fault – no one else’s.
Bad File Permissions
The file permissions are one most important key to security. The files and folders must have safe permissions so that your websites are safe.
Safe permissions: –
Have you ever wondered what decides what permissions should the files under my account needs ? It is the PHP engine that does this job. You need to understand how PHP is configured in your server. There are mainly two ways to configure PHP in a cPanel server and it is either to set PHP run as DSO or using SuExec ( SuPHP, CGI etc ) . If PHP is configured as DSO, the PHP process will be owned by the apache user itself – so, you need to allow the cPanel user as well as the apache user to be able to make changes , ie read and write to your files. If PHP is configured to use SuExec ( suphp or CGI ), php will run as the cPanel user itself, which is the FTP user. So you only need to allow the FTP user to make changes. The former way has been proven to be a faster way to run PHP and the latter is a secure way. If you are hosting a dedicated website in a cPanel server, the DSO will prove to be the fastest and if you are running a shared server, the SuExec way will save a lot of work. If you are on a SuExec server, you need to have all the files to have 644 permissions and folders to have 755 permissions. Then only the PHP will work. To set that, you will need SSH access to your cPanel account. Once you have logged in to your account, you need to run these commands to come back to safe permissions.
cd ~
cd public_html ;
find . -type f -exec chmod 644 {} ;
find . -type d -exec chmod 755 {} ;
When you are a DSO server, you need to run these commands so that your website will work well.
cd ~
cd public_html ;
find . -type f -exec chmod 660 {} ;
find . -type d -exec chmod 770 {} ;
You then need to allow the Apache user ” nobody ” so that it is the group owner of all these files. Then only PHP will be able to make changes in your websites. Not a great idea – still if you can trade that with the speed, that is a great performance boost for the server.
Leave a Reply