Deprecated: Creation of dynamic property wpdb::$categories is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/wp-db.php on line 668

Deprecated: Creation of dynamic property wpdb::$post2cat is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/wp-db.php on line 668

Deprecated: Creation of dynamic property wpdb::$link2cat is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/wp-db.php on line 668

Deprecated: Return type of WP_Theme::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-theme.php on line 554

Deprecated: Return type of WP_Theme::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-theme.php on line 595

Deprecated: Return type of WP_Theme::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-theme.php on line 535

Deprecated: Return type of WP_Theme::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-theme.php on line 544

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/comment-template.php on line 1739

Deprecated: wp_getimagesize(): Implicitly marking parameter $image_info as nullable is deprecated, the explicit nullable type must be used instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/media.php on line 5006

Deprecated: Return type of WP_REST_Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/rest-api/class-wp-rest-request.php on line 960

Deprecated: Return type of WP_REST_Request::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/rest-api/class-wp-rest-request.php on line 980

Deprecated: Return type of WP_REST_Request::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/rest-api/class-wp-rest-request.php on line 992

Deprecated: Return type of WP_REST_Request::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/rest-api/class-wp-rest-request.php on line 1003

Deprecated: Return type of WP_Block_List::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-block-list.php on line 151

Deprecated: Return type of WP_Block_List::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-block-list.php on line 175

Deprecated: Return type of WP_Block_List::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-block-list.php on line 164

Deprecated: Return type of WP_Block_List::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-block-list.php on line 186

Deprecated: Return type of WP_Block_List::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-block-list.php on line 138

Deprecated: Return type of WP_Block_List::offsetExists($index) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-block-list.php on line 75

Deprecated: Return type of WP_Block_List::offsetGet($index) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-block-list.php on line 89

Deprecated: Return type of WP_Block_List::offsetSet($index, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-block-list.php on line 110

Deprecated: Return type of WP_Block_List::offsetUnset($index) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-block-list.php on line 127

Deprecated: Return type of WP_Block_List::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-block-list.php on line 199

Deprecated: Jetpack::setup_xmlrpc_handlers(): Implicitly marking parameter $xmlrpc_server as nullable is deprecated, the explicit nullable type must be used instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/class.jetpack.php on line 939

Deprecated: Automattic\Jetpack\Connection\Manager::setup_xmlrpc_handlers(): Implicitly marking parameter $xmlrpc_server as nullable is deprecated, the explicit nullable type must be used instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/vendor/automattic/jetpack-connection/src/class-manager.php on line 110

Deprecated: Creation of dynamic property Automattic\Jetpack\Connection\Manager::$error_handler is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/vendor/automattic/jetpack-connection/src/class-manager.php on line 80

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Instagram_Gallery::$is_wpcom is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-instagram-gallery.php on line 23

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Mailchimp::$wpcom_is_wpcom_only_endpoint is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-mailchimp.php on line 17

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Tweetstorm_Gather::$wpcom_is_wpcom_only_endpoint is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-tweetstorm-gather.php on line 21

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Tweetstorm_Gather::$is_wpcom is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-tweetstorm-gather.php on line 22

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Gutenberg_Available_Extensions::$wpcom_is_site_specific_endpoint is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/gutenberg-available-extensions.php on line 20

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Memberships::$wpcom_is_wpcom_only_endpoint is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/memberships.php on line 23

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Memberships::$wpcom_is_site_specific_endpoint is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/memberships.php on line 24

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Subscribers::$wpcom_is_wpcom_only_endpoint is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/subscribers.php on line 15

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/extensions/blocks/podcast-player/podcast-player.php on line 157

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/extensions/blocks/podcast-player/podcast-player.php on line 157

Deprecated: Creation of dynamic property Automattic\Jetpack\Sync\Queue::$random_int is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-queue.php on line 38

Deprecated: Creation of dynamic property Automattic\Jetpack\Sync\Queue::$random_int is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-queue.php on line 38

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/widgets/migrate-to-core/image-widget.php on line 195

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/widgets/migrate-to-core/gallery-widget.php on line 56

Deprecated: Creation of dynamic property Publicize_UI::$in_jetpack is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/publicize.php on line 53

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/calypsoify/class-jetpack-calypsoify.php on line 128

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/calypsoify/class-jetpack-calypsoify.php on line 129

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/calypsoify/class-jetpack-calypsoify.php on line 133

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/calypsoify/class-jetpack-calypsoify.php on line 134

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/calypsoify/class-jetpack-calypsoify.php on line 135

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/simple-payments/simple-payments.php on line 219

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/simple-payments/simple-payments.php on line 220

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/simple-payments/simple-payments.php on line 227

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/simple-payments/simple-payments.php on line 229

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/simple-payments/simple-payments.php on line 231

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/simple-payments/simple-payments.php on line 248

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/simple-payments/simple-payments.php on line 249

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/simple-payments/simple-payments.php on line 267

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/simple-payments/simple-payments.php on line 268

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/simple-payments/simple-payments.php on line 270

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/simple-payments/simple-payments.php on line 271

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/simple-payments/simple-payments.php on line 273

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/simple-payments/simple-payments.php on line 275

Deprecated: Creation of dynamic property WPCOM_Widget_Goodreads::$shelves is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/widgets/goodreads.php on line 33

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/script-loader.php on line 348

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property Jetpack_Shortcode_Unavailable::$shortcodes is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-content/plugins/jetpack/modules/shortcodes/unavailable.php on line 19

Warning: Cannot modify header information - headers already sent by (output started at /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/wp-db.php:668) in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1648

Warning: Cannot modify header information - headers already sent by (output started at /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/wp-db.php:668) in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1648

Warning: Cannot modify header information - headers already sent by (output started at /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/wp-db.php:668) in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1648

Warning: Cannot modify header information - headers already sent by (output started at /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/wp-db.php:668) in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1648

Warning: Cannot modify header information - headers already sent by (output started at /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/wp-db.php:668) in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1648

Warning: Cannot modify header information - headers already sent by (output started at /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/wp-db.php:668) in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1648

Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/wp-db.php on line 3030

Warning: Cannot modify header information - headers already sent by (output started at /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/wp-db.php:668) in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1648

Warning: Cannot modify header information - headers already sent by (output started at /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/wp-db.php:668) in /homepages/34/d43362328/htdocs/ydontu/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1648
{"id":325,"date":"2006-07-25T13:08:30","date_gmt":"2006-07-25T13:08:30","guid":{"rendered":"http:\/\/www.whydontyou.org.uk\/blog\/2006\/07\/25\/php-security\/"},"modified":"2008-11-21T22:27:37","modified_gmt":"2008-11-21T22:27:37","slug":"php-security","status":"publish","type":"post","link":"http:\/\/www.whydontyou.org.uk\/blog\/2006\/07\/25\/php-security\/","title":{"rendered":"PHP Security"},"content":{"rendered":"

Short one – the summer 2006 copy of .net has an interesting article on how to secure PHP scripts used in e-commerce (and generally to be honest).<\/p>\n

While overall the article is very well written there is one glaring thing I think is way off the mark. Given that this is not a beginners topic and that on the third page the Author (Paul Hudson<\/a>) talks about editing the httpd.conf file to restrict the X-Powered-By header PHP adds, it is strange that the advice about PHP includes is simply to rename them all from .inc to .php.<\/p>\n

First oddity, it has been quite some time since the standard for php includes was filename.inc but this is minor. Now Mr Hudson’s concern is that people can access the .inc directly and view it as plain text (if they know the name of your .inc file), which is obviously a problem if all your DB logon data is in one.<\/p>\n

Now the solution is massive overkill. If you had a site with (say) ten pages calling the same 10 *.inc files it would be a bit of a pain to change the files to .php and the include() to the new name. Now what if your site was ten times that size? Drama to say the least – even with good old grep.<\/p>\n

Surely the simplest, most common sense solution is to (like mentioned on p84) alter the way the server handles the file? In apache this works – AddType x-mapp-php5 .inc<\/strong> as does AddType application\/x-httpd-php .inc<\/strong>.<\/p>\n

One change and everything is resolved.<\/p>\n

Is this easier or am I mad?<\/p>\n

Share this:<\/h3>