Why does PHPinfo have a header version and a library version? What are the differences?

I have an inconsistency, and I could not correctly align their versions, so I just wanted to delete the library version. I can do it? Is the header version for PHP and the library is from my distribution? Can I upgrade the version of the PHP library? If so, how? I am using PHP 5.4.4

For instance, phpinfo

+6
source share
5 answers

This is often found in updated versions of openssl. It happens that newer versions for libraries are stored in different folders. The original folder located in / usr / bin / openssl will need a symbolic link to the new folder / usr / local / bin / openssl. This can lead to both of them being the same version or just showing the version of OpenSSL _ (whatever)

Usually there is no concern for this, as it still works the way it is intended. This is visible on shared servers.

EDIT:

The information in this post is generic and can be different if you are running CentOS, RedHat, Ubuntu, or another Linux/BSD version. Check documentation or man pages for the best information 

If you are upgrading OpenSSL, some * nix versions require you to rebuild PHP and Apache to upgrade

+1
source

Is the header version for PHP when the library is from my distribution?

This means that it was compiled against the 1.0.1 headers, but is now dynamically linked to 0.9.8. Thus, you are using an older version than what was used when compiling PHP.

Many libraries store the version in header files. Therefore, when a program uses the library, it can do something like int HEADER_FOO_VERSION = LIBRARY_VERSION , which inserts this version number into the program (for example, php). Now, when this program starts, it dynamically links to a library, which may be different than on the host system.

This library may have a function call, for example int get_library_version() . Thus, a program (PHP) can check if HEADER_FOO_VERSION == get_library_version() . If it is different, then a compatibility issue may arise. (Of course, he does not need to assign a local variable ... I'm just trying to bring home that the version number of the header can be compiled in php and remains constant no matter what version of the library is used at runtime.)

Whether this is a problem depends on the compatibility of the two versions.

Usually, if the library is> than the title, you are fine. This is definitely more likely to be a problem if the library is older than the version with which it was linked. Of course, this is because it is impossible to find out what changes future versions may have.

So, in your case, I will try to upgrade your SSL system libraries via apt-get , yum , etc., to match the version expected by PHP.

To check which version of php is used on Linux:

 $ ldd `which php` | grep ssl libssl.so.1.0.0 => /lib/i386-linux-gnu/libssl.so.1.0.0 

Note that which php is just a short description to find the full path. You can program any executable you want to check: ldd /usr/sbin/httpd .

+3
source

I don’t know the answer myself, but when I searched on google for some good resources explaining the same thing .....

What is the difference between a header file and a library?

A file version is the one specified in phpinfo used to create the library.

Hope this helps, there are many resources available when searching on google.

Still, I would like to hear from someone detailed information about the issue

+1
source

The header version is the functionality version, while the library version is the code version.

The header defines the interface - it tells you what functions are in the library. If the title is updated, then you need to check that all functions are the same, and see if they are added or subtracted.

But if the library is updated, and not the title, this means that all function calls are the same, but some of the code can be changed (for example, bug fixes).

In your example, PHP sees OpenSSL 1.0.1 functionality, but the actual version of the source code that OpenSSL loads is 0.9.8o

+1
source

If you are rebuilding PHP from source, I have found another possible reason for the inconsistency. It is so simple, but if you are not familiar with building from a source on Linux, not knowing that it can cost you a lot of time.

The answer is here: https://serverfault.com/a/567705/305059 - unfortunately, I can’t vote for a not very useful answer, so if you have a reputation, please do so.

You need to run "make clean" before "make" so that it can recover all binary files. Oddly enough, without this step, I received an updated version of the library, but the old version of the header - so I think that it should rebuild something, but not all. My rebuild included linking to the curl version elsewhere (built using ssl), which could be the reason for this.

Anyway, I hope this helps someone. Thanks @velcrow on serverfault.

0
source

Source: https://habr.com/ru/post/920545/


All Articles