How to Install Program O – PHP | AIML Chatbot

How to Install Program O

Before we start install Program O, let’s get to know about what is program o and how it works.

What is Program O?

Program O is an open source AIML interpreter written in PHP with MySQL. With the help of Program O you can easily create your own chatbot. It also supports API, so that you can easily experiment it with your own projects or integrate with Facebook Page Messenger or Telegram Bot.

You can test Program O here 

What is AIML?

AIML stands for Artificial Intelligence Markup Language (by Richard Wallace), is an XML dialect for creating natural language for chatbots.  Few important tags of AIML are <aiml>, <category>, <pattern>, <template>. I’m not going to explain all the tags in AIML, you can learn them here.

Following is the simple AIML Example

User: HI

Bot: Hello There!

Install Program O

System Requirements

  • PHP version 5.3 or above
  • MySQL version 5.0 or above
  • Apache 1.3+

Download latest version of Program O from Github or clone it in git bash

Now extract Program O files to the server root or to the folders you want. Let us assume we have extracted the files to folder ‘bot’, so that we access the program o by navigating through url http://example.com/bot/ when installation has completed.

The next step is to create a MySQL database. If you’re using shared hosting you can create MySQL database in your host cpanel.

Now open your browser and navigate through http://example.com/bot/install , a installation page will appear and fill all the Botmaster info, Bot Configuration and Database Configuration as following image and click save.

Program O Installation

Program O LoginWhen everything goes right you will be prompted to next page saying installation is successfull. Now goto http://example.com/bot/admin and enter the username and password that you have entered in Admin Area Username and Password. It will navigate to program o index page.

 

Note: Don’t forget to delete install folder after installation has completed.

You can update the bot in Current Bot section or you can also create multiple bots in current bot section.

Download collection of AIML files from alicebot

Next step is to add bot personality settings. Enter the details you want to add to bot personality.

Your bot won’t work until you upload AIML files. So next step is to create a AIML file.

Create a AIML file with the extension of .aiml (for ex: wiki.aiml) and add the following code

and upload the aiml files to Upload AIML section, now goto ‘test your bot’ section and type ‘WIKI Einstein’ and the bot will response as follow.

User: WIKI Einstein

Bot: Albert Einstein (/ˈaɪnstaɪn/; German: [ˈalbɛɐ̯t ˈaɪnʃtaɪn]; 14 March 1879 – 18 April 1955) was a German-born theoretical physicist.

<wiki> is an inbuild custom tag in Program O which uses wikipedia api to fetch the result. You can create your own aiml custom tag in following path http://example.com/bot/chatbot/addons/custom_tags/custom_tags.php and set it into work by aiml files.

That’s it your bot is ready to respond. If you have any questions or stuck at any point while install program o please feel free to ask in comment box below.

Program O API

Program O also supports API that can be easily integrated with Facebook Page Messenger, Twitter Bot, Telegram Bot and many. You can check example Program O API response here.

The Program O API requires following parameters:

ParamTypeDescription
bot_idintID of the bot you created
saytextUser Input
convo_idtextAny string to track conversation
formatxml/jsonxml / json response

You can test your bot API by navigating through following URL

http://example.com/bot/chatbot/conversation_start.php?bot_id=6&say=what%20is%20your%20name&convo_id=example&format=json

1 Comment

  1. When I try the ‘Test Your Bot’ section, I got this error
    Warning: set_time_limit() has been disabled for security reasons in /storage/ssd4/960/4676960/public_html/bot/chatbot/conversation_start.php on line 13

    Warning: Cannot modify header information – headers already sent by (output started at /storage/ssd4/960/4676960/public_html/bot/chatbot/conversation_start.php:13) in /storage/ssd4/960/4676960/public_html/bot/config/global_config.php on line 58

    I’ve host the program o at my website at 000webhost.com.
    I don’t what is the problem, could you please help me solve this?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.