开发者

php install extension effect

I am just curious about the process of installing an extension bec开发者_开发问答ause I am trying to install php's uploadprogress extension on Ubuntu. I have a default php installation in my usr/ directory, but I have a XAMPP server set up (separate php apache mysql package) in another location in /opt. This is the installation I use for testing.

When I use the command pecl install uploadprogress, the extension installs automatically to the /usr directory. As a test I took the uploadprogress.so file out of the /usr directory php location and put it in the opt location where my XAMPP installation is. I then modified the php.ini for my XAMPP installation and put the extension in. When I ran phpinfo() it showed uploadprogress as installed, however when uploading a file, the uploadprogress function returns null.

My question is, when a php extension is installed, what processes are done, and what files are created and modified? If I manually download the uploadprogress.tgz and manually compile, it still installs to the default directory of /usr/local/php5/ext and I figure there must be more done then just a .so file created in the extension directory. How can I change the location that the extension installs to? I want to have the extension available to my other XAMPP installation in /opt.


My question is, when a php extension is installed, what processes are done, and what files are created and modified?

That depends on the extension, but normally there is the building and compilation of the extension. Temporary files are created, the configuration could getting modified and the actual module file (.so/.dll) is getting written (at least).

Keep in mind that some modules require certain settings in php.ini before they work. If you have copied over only the .so file then you should copy over the relevant part of the php.ini as well.

How can I change the location that the extension installs to?

You normally compile it for the location you want to install it to. If the default location is not the location you want it to be, you can try to specify the output directory in the build process, and there is php-config.


You want to run configure --help to see what options it gives to you to compile the extension and to look for the install directory path option. Maybe this answer helps you with pecl How do you change the default Pear/PECL build folder from /var/tmp?. A .so file is a special standalone library. It's stripped from any linkage and is basically an object file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜