Menu

How can we run custom PHP file in Blogger


PHP stands for Hypertext Preprocessor. PHP is scripting language, can be useful to create dynamic contents and server side activities.  It can be used in combination with various web template systems, CMS and web frameworks.


Why not in Blogger?

However, Blogger platform is not supporting PHP language and many bloggers facing many difficulties to customize and implementing some new and latest developments.

Nothing to worry, because we will approach a tricky way to run php file in blogger. By applying this steps you can show the PHP file executed output in blogger hosting websites.



How can we run custom PHP file in Blogger?

Though, the results are not 100%, but it is far better than not having a PHP code on your blogger site. In this article, we will learn how to run PHP codes in Blogger.

So now I’m going to share a Step by Step guide to teach all of you How can we run custom PHP file in Blogger Blog.


STEP 1 – Creating A PHP File

For using PHP codes in blogger, You have to create a PHP file in which you have to add your PHP codes which you would like to use. Before save it, You have to check it carefully that file you have created is error free, otherwise designs would not look good.

Below I’ve added a simple example of PHP code for beginners which will give a message of Hello Bloggers.

< ?php echo "Hello Bloggers"; ?>

After creating a file make sure that you are saving it by using .PHP extension. For example : hello-bloggers.php. You can create PHP files using any text editors, I have used visual studio editor.


STEP 2 – Find A Free Hosting Website For PHP Code Files

As I’ve mentioned above blogger platform does not give you the facility of placing PHP files. 

Therefore, you have to either host it on your hosting (if you have) or you can use Google Drive to host them for FREE. You can also use Dropbox, and many other free hosting services but certainly they are not better than the features and reliability of Google Drive.


STEP 3 -Adding PHP Code Link in Blogger

After following above steps, Login to Blogger Account >> Select your blog in which you want to run PHP codes >> select your post/page.

You have to paste the following code anywhere you would like to show the gadget, can be added in Sidebar, Footer, Header, Posts or Pages.


<object data="http://examples.com/php-script/hello-bloggers.php" height="400" type="text/html" width="800"></object>


Don’t forget to replace http://examples.com/php-script/hello-bloggers.php with your PHP file URL that you have uploaded to any hosting site like Google Drive or Dropbox.

That’s it.

Congratulations, Now you have successfully added PHP codes to blogger. Open your blog and see it live on your blogger site. 


Please feel free to comment here if you have any questions.

1 comment:

  1. Please check out this website to resize, crop, rotate, flip and to create gif images.
    https://www.resizeimagepixel.com/

    ReplyDelete