Sign in Registration
ruen

Running external programs, how to run EXE in PHP

php-exe

Sometimes the capabilities of the PHP language may not be enough, then you can rent or use your own server, where you can install any additional software.

Before starting to install and configure additional software, you should study PHP capabilities in more detail, maybe the required functionality is already in the language or some library. It is worth referring to official sources - a website, a forum, perhaps there will be a description of how to do this or that. If you still need specific functionality in PHP , then it can probably be done using third-party programs.

Such programs run on the server side. It is important to understand this and not to be confused with when programs are run on the client side. This is technically impossible for security reasons, you can confuse this if you are using a local server - then it will seem that the program is running on the client, but no, the program is launched on behalf of the server.

So, how to start data processing in an external program? First you need to select the desired program, install it and configure it correctly. When everything is ready, then you need to write a PHP script in your project that will interact with the program.

What functions does PHP have to run external programs ? There is a whole separate section on the official website - http://php.net/manual/ru/book.exec.php . All functions and their capabilities are described there. Some of the most requested features:

  • exec - executes an external program,
  • passthru - executes an external program and displays the raw output,
  • system - Executes an external program and displays output.

Which function to use for launching is up to you, depending on your needs. If you just run the program, then the first, if you need to get the result of the program, then look at the others. You can just run the program, and it will output to a specific folder in the form of files, etc.

In order for the program to output data, you must first configure it, or develop your own, which will give data in the desired format. After running the program in this way from PHP, you can get the data and use it in PHP . And then you can do whatever you want with them.

What functionality can be implemented using external programs? It can be anything. For example, photo processing, document creation, video rendering, etc. In short, everything that can be done with a PC.

Comments (0)
For commenting sign in or register.
Оставить заявку

Latest articles

Popular sections

Eqsash (Tools)

Android app - VK LAST USER ID, отучитель от зависимости и т.д.:
Available on Google Play

Amessage (Communication)

Login to the web version
Android app:
Available on Google Play

Share this

Subscribe to

YouTube

Books

IT notes - In simple language about the most necessary things (HTML, CSS, JavaScript, PHP, databases, Drupal, Bitrix, SEO, domains, security and more), PDF, 500 p.