TAILIEUCHUNG - Professional Information Technology-Programming Book part 89

Tham khảo tài liệu 'professional information technology-programming book part 89', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Loadable Modules PHP allows you to load certain extensions at runtime. This means that you can extend the functionality of PHP without needing to recompile from source. Loading Extensions on Demand You use the dl function to dynamically load an extension module. You build extensions as dynamically loadable objects when PHP is compiled by using the --with-EXTENSION shared switch. For instance running the following configure statement causes PHP to be compiled with MySQL support linked in but with socket support as a loadable extension . configure --with-mysql --with-sockets shared The argument given to dl is the filename of the extension. In the case of the sockets extension it would be called on Linux Unix but php_sockets .dll on Windows systems. Loadable Extensions Whether the dl function is available is governed by the enable_dl directive in php. ini. You may find that on a shared web hosting service this feature is not available to you. To check whether an extension is loaded into PHP you use the extension_loaded function. Given an extension name argument this function returns trUE or FALSE depending on the presence of that extension. Note that PHP cannot tell whether an extension was loaded by using dl or is compiled in. Loading Modules on Startup If you have extensions as loadable modules and want them to be loaded into PHP without needing to run dl in every script you can use the extension directive in php. ini to provide a list of extensions to load at startup. Each extension is given on a separate line and there is no limit to the number of extensions you can load in this way. The following lines from php .ini ensure that the sockets and imap extensions are loaded automatically on a Linux Unix server extension extension On a Windows web server the configuration lines need to look like this to reflect the difference in filenames between the two platforms extension php_imap. dll extension Summary In this lesson .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.