Come check us out on IRC: / #mpibot

Socket Support

You may encounter this error: Your PHP install doesn't support sockets. Recompile with –enable-sockets or enable the extension via php.ini … I can not continue If so, you *must* have the sockets extension installed.

Note: If someone would like to rewrite the socketry a little bit to include the ability to act as a client-only with fsockopen(), they are more than welcome.

Here are a few links that might help you out getting it installed and running. Once you have it working properly on your system, mpiBot will continue:

Starting mpiBot

mpiBot, although written in php, is not meant to be run from a web interface. In fact, if you attempt to run it from a web interface, you may see something like this: I think I am running in a web environment. I normally need to be run with php-cli under a shell.

You will need either shell access to a remote *nix machine, or mpiBot will also run on Windows (including remote Windows machines, of course).

On unix-like systems, you can normally start mpiBot by running the ** script:

# sh

Or set it executable and start it as an executable:

# chmod u+x
# ./

For windows, you will most likely need to modify the win-start.bat file that was distributed with mpiBot and change it to the location of your php.exe.

Never run mpiBot in a web interface. Doing so will likely make your hosting provider angry, and the bot will probably not run for long (30-60s).


Configuration is handled in a .conf.php file which is a standard PHP file which is expected to contain specific PHP variables. A stock configuration file is supplied with mpiBot, mpibot.conf.php.

mpiBot was written with the idea that later on more configuration options may be available, or someone would like to write their own. The default configuration driver for mpiBot is called cfg_file. If you would like to move your configuration out of a .php file, you would still need a “bootstrapping” php file to load the approprate cfg driver (e.g., a file with a single variable set: $cfg_driver).

You could base a new type of driver on anything. Some ideas I would like to see:

  • Generic SQL-based driver (mySQL, postgreSQL, SQLite, etc). PDO would likely be ideal here.
  • The original mpi_config syntax. (See [project history])
  • All driver(s) capable of saving and reloading in real time. (See [:developer:pcntl|PCNTL for HUP Signal])

Configuration Options

Cycle Frequency & Cycle Options

The cycle frequency or block_usec is defined as “the period of time given to the bot to complete tasks”. If the bot completes them in less, it will sleep() for the difference of (cycle frequency) - (actual time used in previous cycle). A value of 200,000 usec (0.2sec) is given default which keeps CPU usage low for even a Pentium 4. I use 750,000 (0.75sec) when developing to slow everything down a bit. Extremely low values will cause excessive CPU usage for no real reason.