How To Connect The Library

Table of contents:

How To Connect The Library
How To Connect The Library

Video: How To Connect The Library

Video: How To Connect The Library
Video: How to connect to Siemens S7 plc with C# and Sharp7 library 2024, April
Anonim

Often, programmers are interested in the question of how to increase the number of ready-made libraries of the standard PHP distribution by adding additional external libraries to the collection that are required for the development of various projects.

How to connect the library
How to connect the library

Instructions

Step 1

To connect an additional library, you need to know that each library is a set of PHP scripts, which means that, like other scripts, they can be connected with include and require statements by copying them to the folder with the desired project, while maintaining the PHP directory structure. library permanent.

Step 2

If you would like the library files to be distributed with the project, this is the way to go.

Step 3

Also, you can use the same copy of the library in several different projects. To do this, in the php.ini file, write down the path of the library location using the include_path parameter - for example, if you placed the library by unpacking it from the archive in a folder on the C: drive - the location path will look like this: include_path = "…; C: library_php; …"

Step 4

Before and after the above library, specify the paths for the rest of the libraries. Semicolons in the original code before parameters should be removed, since with them the line of code turns into a comment. In addition, you can use the library using the require_once parameter.

Step 5

The PEAR package, which consists of interconnected PHP libraries, can help you to connect additional libraries. To use PEAR packages for work, install a package manager, the program for managing these library packages.

Step 6

Using the program, you can download additional packages from the Internet and install them with the pear_install parameter. The installation command will be the same if you install the package from your computer and not from the network. The library files will be located in the PEAR folder, which will appear in the PHP folder after installation.

Recommended: