|
|
PHP (angielski akronim rekurencyjny, którego rozwinięcie to PHP Hypertext Preprocessor), pierwotnie nazwany Personal
Home Page - skryptowy język programowania, służący przede wszystkim do tworzenia dynamicznych stron WWW i wykonywany w
tym przypadku po stronie serwera, z możliwością zagnieżdżania w HTML (bądź XHTML). PHP jest podobny w założeniach do
dużo starszego mechanizmu SSI (Server Side Includes), jednak jest w stosunku do SSI nieporównanie bardziej rozbudowany.
Udostępniany jest na zasadach licencji open-source. Jego składnia bazuje na językach C, Java i Perl.
SQL (ang. Structured Query Language) to strukturalny język zapytań używany do tworzenia, modyfikowania baz danych oraz
do umieszczania i pobierania danych z baz danych.
Język SQL jest językiem deklaratywnym. Decyzję o sposobie przechowywania i pobrania danych pozostawia się systemowi
zarządzania bazą danych DBMS.
Jest to język programowania opracowany w latach siedemdziesiątych w firmie IBM. Stał się on standardem w komunikacji z
serwerami relacyjnych baz danych. Wiele współczesnych systemów relacyjnych baz danych używa do komunikacji z
użytkownikiem SQL, dlatego mówi się, że korzystanie z relacyjnych baz danych, to korzystanie z SQL-a.
Apache jest otwartym serwerem HTTP dostępnym dla wielu systemów operacyjnych (m.in. UNIX, GNU/Linux, BSD,
Microsoft Windows). Po angielsku słowo Apache wymawia się epaczi, co brzmi tak samo jak a patchy (server), co było
określeniem tego serwera we wczesnym stadium jego rozwoju w 1995 roku, kiedy był on głównie zbiorem poprawek (patch)
nałożonych na serwer HTTP o nazwie NCSA.
Apache jest najszerzej stosowanym serwerem HTTP w Internecie. W maju 2003 jego udział wśród serwerów wynosił 62%. W
połączeniu z interpreterem języka skryptowego PHP i bazą danych MySQL, Apache stanowi jedno z najczęściej spotykanych
środowisk w firmach oferujących miejsce na serwerach sieciowych.
|
dl
(PHP 3, PHP 4, PHP 5) dl -- Loads a PHP extension at
runtime
Descriptionint dl ( string
library )
Loads the PHP extension given by the parameter library. The library parameter is only the filename of
the extension to load which also depends on your platform. For
example, the sockets extension
(if compiled as a shared module, not the default!) would be
called sockets.so on Unix platforms
whereas it is called php_sockets.dll
on the Windows platform.
Zwraca TRUE w przypadku
sukcesu, FALSE w przypadku
porażki. If the functionality of loading modules is not
available (see Note) or has been disabled (either by turning it
off enable_dl or by enabling
tryb bezpieczny
in php.ini) an E_ERROR is emitted and execution is
stopped. If dl() fails because the
specified library couldn't be loaded, in addition to FALSE an E_WARNING message is emitted.
Use extension_loaded() to test whether a given
extension is already available or not. This works on both
built-in extensions and dynamically loaded ones (either through
php.ini or dl()).
The dl() function is deprecated as
of PHP 5. Use Extension
Loading Directives method instead.
Przykład 1. dl() examples
<?php // Example loading an extension based on OS
if (!extension_loaded('sqlite')) {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
dl('php_sqlite.dll');
} else {
dl('sqlite.so');
}
}
// Or, the PHP_SHLIB_SUFFIX constant is available as of PHP 4.3.0
if (!extension_loaded('sqlite')) {
$prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
dl($prefix . 'sqlite.' . PHP_SHLIB_SUFFIX);
} ?> |
|
The directory where the extension is loaded from depends on
your platform:
Windows - If not explicitly set in the php.ini, the extension is loaded from
c:\php4\extensions\ by default.
Unix - If not explicitly set in the php.ini, the default extension directory
depends on
-
whether PHP has been built with --enable-debug or not
-
whether PHP has been built with (experimental) ZTS (Zend
Thread Safety) support or not
-
the current internal ZEND_MODULE_API_NO (Zend internal module
API number, which is basically the date on which a major
module API change happened, e.g. 20010901)
Taking into account the above, the directory then defaults
to <install-dir>/lib/php/extensions/
<debug-or-not>-<zts-or-not>-ZEND_MODULE_API_NO,
e.g. /usr/local/php/lib/php/extensions/debug-non-zts-20010901
or /usr/local/php/lib/php/extensions/no-debug-zts-20010901.
Notatka: dl() is
not
supported in multithreaded Web servers. Use the extensions statement in your php.ini when operating under such an
environment. However, the CGI
and CLI build are not affected !
Notatka: Since PHP 6 this function is disabled in
all SAPIs, except CLI, CGI and embed.
Notatka: dl() is case
sensitive on Unix platforms.
See also Extension
Loading Directives and extension_loaded().
|