1
0
mirror of https://github.com/php/doc-uk.git synced 2026-03-23 22:52:14 +01:00

Completed FAQ translation, updated some text, fixed errors

This commit is contained in:
Mike Proshchuk
2023-12-13 00:44:09 +02:00
parent 510d20a0bc
commit 3cfcc711df
21 changed files with 878 additions and 1126 deletions

View File

@@ -99,8 +99,8 @@
<para>
З метою покриття ліцензією (на цей момент Creative Commons Attribution),
нотатки, внесені користувачами вважаються частиною посібника з PHP і тому на
них поширюється та сама ліцензія, яка охоплює цю документацію. За більш
детальною інформацією перейдіть на сторінку
них поширюється та сама ліцензія, яка охоплює цю документацію. За
докладнішою інформацією перейдіть на сторінку
<link linkend="copyright">Авторські права на посібник</link>.
</para>
</note>
@@ -236,7 +236,7 @@ strlen ( string $string ) : int
називається <parameter>strict</parameter>. Усі необов'язкові параметри
мають початкові значення; якщо початкове значення невідоме, то це показано
символом <literal>?</literal>. Посібник зазначає, що параметр
<parameter>strict</parameter> початково є логічним &false;. Детальніше про
<parameter>strict</parameter> початково є логічним &false;. Докладніше про
роботу функцій дивіться на сторінках посібника щодо кожної з них.
</para>
<para>
@@ -359,7 +359,7 @@ strlen ( string $string ) : int
<para>
Надсилаючи нотатки, користувачі можуть надавати додаткові приклади,
застереження та роз'яснення для інших читачів. Але, будь ласка, не
повідомляйте про помилки, використовуючи систему аннотацій. Детальніше про це
повідомляйте про помилки, використовуючи систему анотацій. Докладніше про це
у розділі <link linkend="about.notes">"Про нотатки користувачів"</link>.
</para>
<para>

View File

@@ -9,7 +9,7 @@
</term>
<listitem>
<para>
Увімкути, щоб правила та залежності були некорисними (а іноді заплутаними)
Увімкнути, щоб правила та залежності були некорисними (а іноді заплутаними)
для звичайного інсталятора.
</para>
</listitem>
@@ -41,7 +41,7 @@
</term>
<listitem>
<para>
Визначає теку з бібліотекати для збирання PHP у системі Unix. Для
Визначає теку з бібліотеками для збирання PHP у системі Unix. Для
64-бітних систем треба задавати цей параметр до теки
<literal>lib64</literal> так: <literal>--with-libdir=lib64</literal>.
</para>

View File

@@ -410,7 +410,7 @@ echo "Стиснений файл має " . filesize('test.deflated') . " ба
стандартне значення бібліотеки bzip.
Фільтр <literal>bzip2.decompress</literal> приймає лиш один параметр,
котрий може бути задано звичайним логічним значенням або елементом
якому задається звичайне логічне значенням або елемент
<parameter>small</parameter> асоціативного масиву.
Коли <parameter>small</parameter> має значення &true;, бібліотека bzip

View File

@@ -17,7 +17,7 @@
<para>
Ця нова мінорна версія приносить з собою ряд
<link linkend="migration83.new-features">нових можливостей</link> та
<link linkend="migration83.incompatible">деяких несумісностей</link>, котрі
<link linkend="migration83.incompatible">деяких несумісностей</link>, які
потрібно перевірити перед перемиканням версій PHP виробничих середовищ.
</para>

View File

@@ -134,7 +134,7 @@
</para>
<para>
INI налаштування <literal>assert.*</literal> застаріли. Детально:
INI налаштування <literal>assert.*</literal> застаріли. Докладно:
<link linkend="migration83.other-changes.ini">Зміни в обробці файлів INI
</link>.
</para>

View File

@@ -3,7 +3,7 @@
<appendix xml:id="transports" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Перелік підтримуваних транспортних протоколів у сокетах</title>
<para>
Нижче наведено список різноманітних транспортних протоколів в URL стилі, котрі
Нижче наведено список різноманітних транспортних протоколів в URL стилі, які
вбудовані в PHP для використання з функціями сокетів на основі потоків, як-от
<function>fsockopen</function> і <function>stream_socket_client</function>.
Цих протоколів <emphasis>немає</emphasis> у

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 9e2d8231b5d8a3795b365c6770fab288e59e6249 Maintainer: mproshchuk Status: wip -->
<!-- EN-Revision: 9e2d8231b5d8a3795b365c6770fab288e59e6249 Maintainer: mproshchuk Status: ready -->
<!--
Entities for the categorized extension list, so it does not need
@@ -76,11 +76,11 @@ PHP за допомогою опцій компіляції.</para>'>
<para xmlns="http://docbook.org/ns/docbook">Ці розширення поставляються разом з PHP,
але для того, щоб їх компілювати, потрібні зовнішні бібліотеки.</para>'>
<!ENTITY extcat.membership.pecl '<title xmlns="http://docbook.org/ns/docbook">Розширення PECL</title>
<para xmlns="http://docbook.org/ns/docbook">Ці розширення доступні в
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&url.pecl;">PECL</link>.
Вони можуть потребувати зовнішніх бібліотек. Існує більше PECL
розширень, але вони покищо недокументовані в посібнику з PHP.</para>'>
<!ENTITY extcat.membership.pecl '<title xmlns="http://docbook.org/ns/docbook">
Розширення PECL</title><para xmlns="http://docbook.org/ns/docbook">Ці розширення
доступні на &link.pecl;. Вони можуть потребувати зовнішніх бібліотек. Існує
більше розширень PECL, але вони поки що недокументовані в посібнику з PHP.
</para>'>
<!-- ======================================================================= -->

View File

@@ -1,34 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: b8e1b1357def73f310c9f7405035b3acc0cb1eaf Maintainer: mproshchuk Status: wip -->
<!-- EN-Revision: b8e1b1357def73f310c9f7405035b3acc0cb1eaf Maintainer: mproshchuk Status: ready -->
<chapter xml:id="faq.build" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Build Problems</title>
<titleabbrev>Build Problems</titleabbrev>
<title>Проблеми збірки</title>
<titleabbrev>Проблеми збірки</titleabbrev>
<para>
This section gathers most common errors that occur at
build time.
У цьому розділі зібрано найпоширеніші помилки, які виникають під час
збирання PHP.
</para>
<qandaset>
<qandaentry xml:id="faq.build.configure">
<question>
<para>
I got the latest version of PHP using the anonymous Git service,
but there's no configure script!
Я отримав останню версію PHP, використавши анонімний сервіс Git, але в ній
немає скрипту конфігурації!
</para>
</question>
<answer>
<para>
You have to have the GNU autoconf package installed so you can
generate the configure script from <filename>configure.in</filename>. Just run
<command>./buildconf</command> in the top-level directory after getting
the sources from the Git server. (Also, unless you run <command>configure</command>
with the <literal>--enable-maintainer-mode</literal> option, the
configure script will not automatically get rebuilt when the
<filename>configure.in</filename> file is updated, so you should make sure to do that
manually when you notice <filename>configure.in</filename> has changed. One symptom
of this is finding things like @VARIABLE@ in your Makefile after
configure or <filename>config.status</filename> is run.)
У вас має бути встановленим пакунок GNU autoconf, за допомогою якого
зможете генерувати скрипт конфігурації з
<filename>configure.in</filename>. Достатньо виконати
<command>./buildconf</command> в початковій теці після отримання
початкового коду з сервера Git. (Крім того, допоки ви не запустите
<command>configure</command> з параметром
<literal>--enable-maintainer-mode</literal>, скрипт конфігурації не буде
автоматично перебудовано, коли файл <filename>configure.in</filename>
оновиться, і вам доведеться робити це вручну, коли
<filename>configure.in</filename> зміниться. Ознакою того є слова
@VARIABLE@ у вашому Makefile після запуску конфігурації чи
<filename>config.status</filename>.)
</para>
</answer>
</qandaentry>
@@ -36,18 +38,17 @@
<qandaentry xml:id="faq.build.configuring">
<question>
<para>
I'm having problems configuring PHP to work with Apache.
It says it can't find <filename>httpd.h</filename>, but it's right where I said it is!
Я маю проблеми з налаштуванням PHP для роботи з Apache. Каже, що не може
знайти <filename>httpd.h</filename>, проте він точно там, де я вказав!
</para>
</question>
<answer>
<para>
You need to tell the configure/setup script the location of the
top-level of your Apache source tree. This means that
you want to specify <option
role="configure">--with-apache=/path/to/apache</option>
and <emphasis>not</emphasis> <option
role="configure">--with-apache=/path/to/apache/src</option>.
Ви повинні назвати скрипту конфігурації розташування початкової теки
початкових кодів Apache. Це означає, що треба вказати
<option role="configure">--with-apache=/path/to/apache</option>, а
<emphasis>не</emphasis>
<option role="configure">--with-apache=/path/to/apache/src</option>.
</para>
</answer>
</qandaentry>
@@ -55,8 +56,8 @@
<qandaentry xml:id="faq.build.lex">
<question>
<para>
While configuring PHP (<literal>./configure</literal>), you come across
an error similar to the following:
Під час конфігурації PHP (<literal>./configure</literal>), ви натрапили на
помилку, подібну до наступної:
</para>
<para>
<screen>
@@ -67,10 +68,11 @@
</question>
<answer>
<para>
Be sure to read the <link linkend="install.unix">installation</link>
instructions carefully and note that you need both flex and bison
installed to compile PHP. Depending on your setup you will install
bison and flex from either source or a package, such as a RPM.
Уважно перечитайте інструкції зі
<link linkend="install.unix">встановлення</link> та майте на увазі, що вам
потрібні встановлені пакунки flex і bison, щоб скомпілювати PHP. Залежно
від ваших налаштувань, bison і flex встановлюються або з джерела, або з
пакета, наприклад RPM.
</para>
</answer>
</qandaentry>
@@ -78,7 +80,7 @@
<qandaentry xml:id="faq.build.apache-sharedcore">
<question>
<para>
When I try to start Apache, I get the following message:
Коли я намагаюся запустити Apache, отримую таке повідомлення:
</para>
<para>
<screen>
@@ -89,10 +91,9 @@
</question>
<answer>
<para>
This error usually comes up when one compiles the Apache
core program as a DSO library for shared usage. Try to
reconfigure apache, making sure to use at least the
following flags:
Зазвичай ця помилка з'являється, коли Apache було скомпільовано, як DSO
для спільного використання. Спробуйте переконфігурувати Apache,
упевнившись, що ви використали принаймні наступні прапорці:
</para>
<para>
<screen>
@@ -100,9 +101,9 @@
</screen>
</para>
<para>
For more information, read the top-level Apache
<filename>INSTALL</filename> file or the Apache
<link xlink:href="&url.apachedso;">DSO manual page</link>.
Більше інформації вгорі файлу Apache'а <filename>INSTALL</filename> або на
<link xlink:href="&url.apachedso;">Сторінці посібника з DSO</link> від
Apache.
</para>
</answer>
</qandaentry>
@@ -110,21 +111,22 @@
<qandaentry xml:id="faq.build.not-found">
<question>
<para>
When I run configure, it says that it can't find the
include files or library for GD, gdbm, or some other package!
Коли я запускаю скрипт конфігурації, він каже, що не може включити файли
або бібліотеку GD, gdbm, чи якогось іншого пакунка.
</para>
</question>
<answer>
<para>
You can make the configure script look for header files and libraries
in non-standard locations by specifying additional flags to pass to
the C preprocessor and linker, such as:
Ви можете зробити так, щоб скрипт конфігурації шукав файли-заголовки та
бібліотеки в нестандартних місцях, задавши додаткові прапорці для
препроцесора C і компонувальника, наприклад:
<programlisting>
<![CDATA[
CPPFLAGS=-I/path/to/include LDFLAGS=-L/path/to/library ./configure
]]>
</programlisting>
If you're using a csh-variant for your login shell (why?), it would be:
Якщо ви використовуєте csh-варіант оболонки для авторизації (а нащо?), це
буде:
<programlisting>
<![CDATA[
env CPPFLAGS=-I/path/to/include LDFLAGS=-L/path/to/library ./configure
@@ -137,14 +139,14 @@
<qandaentry xml:id="faq.build.yytname">
<question>
<para>
When it is compiling the file <filename>language-parser.tab.c</filename>, it gives me errors
that say <literal>yytname undeclared</literal>.
Коли компілюється файл <filename>language-parser.tab.c</filename>, то
виводяться помилки <literal>yytname undeclared</literal>.
</para>
</question>
<answer>
<para>
You need to update your version of Bison. You can find the latest version
at <link xlink:href="&url.bison;">&url.bison;</link>.
Вам треба оновити пакунок Bison. Найновіша версія за адресою
<link xlink:href="&url.bison;">&url.bison;</link>.
</para>
</answer>
</qandaentry>
@@ -152,17 +154,17 @@
<qandaentry xml:id="faq.build.link">
<question>
<para>
When I run <command>make</command>, it seems to run fine but then fails when it tries
to link the final application complaining that it can't find some files.
Коли я запускаю <command>make</command>, наче все йде добре, але
завершується невдачею під час компонування програми, скаржачись, що не
може знайти якісь файли.
</para>
</question>
<answer>
<para>
Some old versions of make that don't correctly put the compiled
versions of the files in the functions directory into that same
directory. Try running <command>cp *.o functions</command> and then
re-running <command>make</command> to see if that helps. If it does, you should really
upgrade to a recent version of GNU make.
Деякі старі версії make не можуть правильно помістити скомпільовані файли
у теки. Спробуйте запустити <command>cp *.o functions</command>, потім
перезапустити <command>make</command>, щоб побачити, чи це допоможе. Якщо
так, то вам конче треба отримати найновішу версію GNU make.
</para>
</answer>
</qandaentry>
@@ -170,19 +172,18 @@
<qandaentry xml:id="faq.build.undefined">
<question>
<para>
When linking PHP, it complains about a number of undefined references.
Коли компоную PHP, воно скаржиться на кількість невизначених посилань.
</para>
</question>
<answer>
<para>
Take a look at the link line and make sure that all of the appropriate
libraries are being included at the end. Common ones that you might have
missed are '-ldl' and any libraries required for any database support
you included.
Подивіться на рядок з посиланнями, та упевніться, що усі необхідні
бібліотеки були включені. Здебільшого це "-ldl" та бібліотеки, потрібні
для включених баз даних.
</para>
<para>
Some people have also reported that they had to add '-ldl' immediately
following <filename>libphp4.a</filename> when linking with Apache.
Дехто каже, що треба дописати '-ldl' відразу після
<filename>libphp4.a</filename>, коли компонуєте модуль для Apache.
</para>
</answer>
</qandaentry>
@@ -190,48 +191,45 @@
<qandaentry xml:id="faq.build.not-running">
<question>
<para>
I have followed all the steps to install the Apache module version on
Unix, and my PHP scripts show up in my browser or I am being asked to
save the file.
Я послідовно виконав усі кроки встановлення PHP, як модуля Apache у Unix,
а мої скрипти показуються в браузері, як простий текст, або браузер
пропонує мені зберегти файл.
</para>
</question>
<answer>
<para>
This means that the PHP module is not getting invoked for some reason.
Three things to check before asking for further help:
Це означає, що PHP-модуль чомусь не викликається.
Перед проханням про додаткову допомогу треба перевірити три речі:
<itemizedlist>
<listitem>
<simpara>
Make sure that the httpd binary you are running is the actual
new httpd binary you just built. To do this, try running:
<literal>/path/to/binary/httpd -l</literal>
Упевніться, що запущений вами двійковий httpd — той, що ви перед
цим зібрали. Для цього виконайте: <literal>/path/to/binary/httpd -l</literal>
</simpara>
<simpara>
If you don't see <filename>mod_php4.c</filename> listed then
you are not running the right binary. Find and install the
correct binary.
Якщо ви не бачите у списку <filename>mod_php4.c</filename>, отже
запущено не той двійковий файл. Знайдіть і встановіть потрібний.
</simpara>
</listitem>
<listitem>
<simpara>
Make sure you have added the correct Mime Type to one of your
<literal>Apache .conf</literal> files. It should be:
Упевніться, що ви додали правильний MIME тип у одному з ваших
<literal>.conf</literal> файлів Apache. Наприклад:
<literal>AddType application/x-httpd-php .php</literal>
</simpara>
<simpara>
Also make sure that this AddType line is not hidden away inside a
&lt;Virtualhost&gt; or &lt;Directory&gt; block which would
prevent it from applying to the location of your test script.
Також перевірте, чи інструкція AddType не знаходиться за межами
блоку &lt;Virtualhost&gt; або &lt;Directory&gt;, бо це не дозволить
застосувати її до вашого тестового скрипта.
</simpara>
</listitem>
<listitem>
<simpara>
Finally, the default location of the Apache configuration files
changed between Apache 1.2 and Apache 1.3. You should check to
make sure that the configuration file you are adding the AddType
line to is actually being read. You can put an obvious syntax error
into your &httpd.conf; file or some other obvious change that will
tell you if the file is being read correctly.
В решті решт, стандартне розташування файлів конфігурації Apache у
версій 1.2 і 1.3 — відрізняється. Перевірте, що файли конфігурації,
в які ви записали AddType, будуть прочитані. Можна навмисно внести
помилку у ваш файл &httpd.conf; або будь-яку іншу очевидну зміну, яка
сигналізуватиме, що файл прочитано коректно.
</simpara>
</listitem>
</itemizedlist>
@@ -242,16 +240,17 @@
<qandaentry xml:id="faq.build.activate-module">
<question>
<para>
It says to use: <literal>--activate-module=src/modules/php4/libphp4.a</literal>,
but that file doesn't exist, so I changed it to
<literal>--activate-module=src/modules/php4/libmodphp4.a</literal> and it
doesn't work!? What's going on?
Там сказано використати
<literal>--activate-module=src/modules/php4/libphp4.a</literal>, але
такого файлу немає, тож я замінив параметр на
<literal>--activate-module=src/modules/php4/libmodphp4.a</literal>, та це
не спрацювало! Що відбувається?
</para>
</question>
<answer>
<para>
Note that the <filename>libphp4.a</filename> file is not supposed to exist. The
apache process will create it!
Зауважте, що файлу <filename>libphp4.a</filename> і не має існувати.
Процес Apache створить його!
</para>
</answer>
</qandaentry>
@@ -259,15 +258,16 @@
<qandaentry xml:id="faq.build.ansi">
<question>
<para>
When I try to build Apache with PHP as a static module using
<literal>--activate-module=src/modules/php4/libphp4.a</literal>
it tells me that my compiler is not ANSI compliant.
Коли я намагаюсь зібрати Apache із PHP, як статичним модулем,
використовуючи
<literal>--activate-module=src/modules/php4/libphp4.a</literal>, воно
каже, що мій компілятор не сумісний з ANSI.
</para>
</question>
<answer>
<para>
This is a misleading error message from Apache that has been fixed
in more recent versions.
Це хибне повідомлення про помилку від Apache, яке буде виправлене в
майбутніх версіях.
</para>
</answer>
</qandaentry>
@@ -275,19 +275,20 @@
<qandaentry xml:id="faq.build.apxs">
<question>
<para>
When I try to build PHP using <option
role="configure">--with-apxs</option> I get strange error messages.
Коли я намагаюся зібрати PHP, використовуючи
<option role="configure">--with-apxs</option>, отримую дивне повідомлення
про помилку.
</para>
</question>
<answer>
<para>
There are three things to check here. First, for some reason
when Apache builds the apxs Perl script, it sometimes ends up
getting built without the proper compiler and flags variables.
Find your apxs script (try the command <command>which apxs</command>),
it's sometimes found in <filename>/usr/local/apache/bin/apxs</filename>
or <filename>/usr/sbin/apxs</filename>.
Open it and check for lines similar to these:
Треба перевірити три речі. По-перше, інколи Apache створює
Perl-скрипт "apxs", а останній не містить даних про потрібний
компілятор та поставлених прапорців. Знайдіть ваш скрипт apxs (спробуйте
команду <command>which apxs</command>), зазвичай він знаходиться у
<filename>/usr/local/apache/bin/apxs</filename> або
<filename>/usr/sbin/apxs</filename>. Відкрийте його і перевірте рядки,
схожі на ці:
<programlisting>
<![CDATA[
my $CFG_CFLAGS_SHLIB = ' '; # substituted via Makefile.tmpl
@@ -295,9 +296,9 @@ my $CFG_LD_SHLIB = ' '; # substituted via Makefile.tmpl
my $CFG_LDFLAGS_SHLIB = ' '; # substituted via Makefile.tmpl
]]>
</programlisting>
If this is what you see, you have found your problem. They may
contain just spaces or other incorrect values, such as 'q()'. Change
these lines to say:
Якщо це те, що ви бачите, проблему знайдено. Вони можуть містити тільки
пробіли або інші некоректні значення, такі як 'q()'. Замініть ці рядки на
наступні:
<programlisting>
<![CDATA[
my $CFG_CFLAGS_SHLIB = '-fpic -DSHARED_MODULE'; # substituted via Makefile.tmpl
@@ -305,21 +306,22 @@ my $CFG_LD_SHLIB = 'gcc'; # substituted via Makefile.tmpl
my $CFG_LDFLAGS_SHLIB = q(-shared); # substituted via Makefile.tmpl
]]>
</programlisting>
The second possible problem should only be an issue on Red Hat 6.1
and 6.2. The apxs script Red Hat ships is broken. Look for this line:
Друга можлива проблема може виникати у Red Hat 6.1 та 6.2. Скрипт apxs у
Red Hat зламаний. Знайдіть цей рядок:
<programlisting>
<![CDATA[
my $CFG_LIBEXECDIR = 'modules'; # substituted via APACI install
]]>
</programlisting>
If you see the above line, change it to this:
Якщо ви бачите такий рядок, замініть його на:
<programlisting>
<![CDATA[
my $CFG_LIBEXECDIR = '/usr/lib/apache'; # substituted via APACI install
]]>
</programlisting>
Last, if you reconfigure/reinstall Apache, add a <command>make clean</command>
to the process after <command>./configure</command> and before <command>make</command>.
По-третє, якщо переналаштовуєте або перевстановлюєте Apache, допишіть
<command>make clean</command> після <command>./configure</command> та
перед <command>make</command>.
</para>
</answer>
</qandaentry>
@@ -327,14 +329,14 @@ my $CFG_LIBEXECDIR = '/usr/lib/apache'; # substituted via APACI install
<qandaentry xml:id="faq.build.microtime">
<question>
<para>
During <command>make</command>, I get errors in microtime,
and a lot of <literal>RUSAGE_</literal> stuff.
Протягом виконання <command>make</command> часто з'являються помилки і
більшість про <literal>RUSAGE_</literal>.
</para>
</question>
<answer>
<para>
During the <command>make</command> portion of installation,
if you encounter problems that look similar to this:
Якщо протягом виконання <command>make</command> ви зіткнулися з такими
проблемами:
<programlisting>
<![CDATA[
microtime.c: In function `php_if_getrusage':
@@ -354,10 +356,10 @@ make: *** [all-recursive] Error 1
</programlisting>
</para>
<para>
Your system is broken. You need to fix your <filename>/usr/include</filename> files by
installing a glibc-devel package that matches your glibc. This has
absolutely nothing to do with PHP. To prove this to yourself, try this
simple test:
Ваша система зламана. Потрібно полагодити ваші файли у
<filename>/usr/include</filename>, встановивши пакунок glibc-devel, з тою
ж версією, що і у вашого glibc. Це не має абсолютно нічого спільного з
PHP. Щоб переконатися в цьому, спробуйте цей простий тест:
<programlisting>
<![CDATA[
$ cat >test.c <<X
@@ -366,7 +368,7 @@ X
$ gcc -E test.c >/dev/null
]]>
</programlisting>
If that spews out errors, you know your include files are messed up.
Якщо висвітяться помилки, знайте — ваші include-файли зіпсовані.
</para>
</answer>
</qandaentry>
@@ -374,27 +376,26 @@ $ gcc -E test.c >/dev/null
<qandaentry xml:id="faq.build.mysql.tempnam">
<question>
<para>
When compiling PHP with MySQL, configure runs fine but during
<literal>make</literal> I get an error similar to the following:
Коли компілюю PHP з підтримкою MySQL, configure працює добре, але
виконуючи <literal>make</literal>, я отримую помилку схожу на:
<emphasis>ext/mysql/libmysqlclient/my_tempnam.o(.text+0x46): In function
my_tempnam': /php4/ext/mysql/libmysqlclient/my_tempnam.c:103: the
use of tempnam' is dangerous, better use mkstemp'</emphasis>,
what's wrong?
що не так?
</para>
</question>
<answer>
<para>
First, it's important to realize that this is a <literal>
Warning</literal> and not a fatal error. Because this is
often the last output seen during <literal>make</literal>,
it may seem like a fatal error but it's not. Of course, if
you set your compiler to die on Warnings, it will. Also
keep in mind that MySQL support is enabled by default.
Найперше, важливо усвідомити, що це <literal>попередження</literal>, а не
фатальна помилка. Через те, що здебільшого це кінцевий вивід команди
<literal>make</literal>, може здатися, що це фатальна помилка, але ні.
Звісно, якщо ви налаштували свій компілятор "вмирати" від попереджень, то
це буде нею. Ще майте на увазі, що стандартно підтримка MySQL ввімкнена.
</para>
<note>
<para>
As of PHP 4.3.2, you'll also see the following text after
the build (make) completes:
Починаючи з PHP 4.3.2, після завершення збірки (make) ви також бачитимете
наступний текст:
</para>
<para>
<screen>
@@ -409,21 +410,22 @@ $ gcc -E test.c >/dev/null
<qandaentry xml:id="faq.build.upgrade">
<question>
<para>
I want to upgrade my PHP. Where can I find the <command>./configure</command>
line that was used to build my current PHP installation?
Я хочу оновити мій PHP. Де я можу дізнатися повну команду
<command>./configure</command>, яка була виконана для збирання
поточної встановленої версії?
</para>
</question>
<answer>
<para>
Either you look at config.nice file, in the source tree of your current PHP
installation or, if this is not available, you simply run a
У файлі config.nice, або у дереві початкових кодів встановленого PHP, якщо це
недоступно, можете просто запустити скрипт
<programlisting role="php">
<![CDATA[
<?php phpinfo(); ?>
]]>
</programlisting>
script. On top of the output the <command>./configure</command> line, that was used
to build this PHP installation is shown.
</programlisting>. Вгорі результату буде показано командний рядок
<command>./configure</command>, який було використано для збирання даної
версії PHP.
</para>
</answer>
</qandaentry>
@@ -431,14 +433,14 @@ $ gcc -E test.c >/dev/null
<qandaentry xml:id="faq.build.gdlibs">
<question>
<para>
When building PHP with the GD library it either gives strange compile errors
or segfaults on execution.
Під час збирання PHP з підтримкою GD виводяться дивні помилки компіляції
або під час виконання — помилки сегментації.
</para>
</question>
<answer>
<para>
Make sure your GD library and PHP are linked against the same depending
libraries (e.g. libpng).
Упевніться, що ваша бібліотека GD та PHP залежні від однакових бібліотек
(напр. libpng).
</para>
</answer>
</qandaentry>
@@ -446,19 +448,19 @@ $ gcc -E test.c >/dev/null
<qandaentry xml:id="faq.installation.needgnu">
<question>
<para>
When compiling PHP I seemingly get random errors, like it hangs.
I'm using Solaris if that matters.
Під час компіляції PHP я, здається, отримую випадкові помилки, наче вона
зависає. Я використовую Solaris, якщо це важливо.
</para>
</question>
<answer>
<para>
Using non-GNU utilities while compiling PHP may cause problems. Be
sure to use GNU tools in order to be certain that compiling PHP will
work. For example, on Solaris, using either the SunOS BSD-compatible
or Solaris versions of <literal>sed</literal> will not work, but using
the GNU or Sun POSIX (xpg4) versions of <literal>sed</literal> will
work. Links: <link xlink:href="&url.sed;">GNU sed</link>,
<link xlink:href="&url.flex;">GNU flex</link>, and
Використання не-GNU утиліт для компіляції PHP може спричинити проблеми.
Використовуйте інструменти GNU для впевненості у належній компіляції PHP.
Наприклад, у Solaris, використання BSD-сумісних версій
<literal>sed</literal> від SunOS або Solaris не спрацює, натомість версії
<literal>sed</literal> від GNU або Sun POSIX (xpg4) будуть працювати.
Посилання: <link xlink:href="&url.sed;">GNU sed</link>,
<link xlink:href="&url.flex;">GNU flex</link> та
<link xlink:href="&url.bison;">GNU bison</link>.
</para>
</answer>

View File

@@ -1,24 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 2bb07c8c43f028c665a33bfc08a22639e9e35dc6 Maintainer: mproshchuk Status: wip -->
<!-- EN-Revision: 2bb07c8c43f028c665a33bfc08a22639e9e35dc6 Maintainer: mproshchuk Status: ready -->
<chapter xml:id="faq.com" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>PHP and COM</title>
<titleabbrev>PHP and COM</titleabbrev>
<title>PHP і COM</title>
<titleabbrev>PHP і COM</titleabbrev>
<para>
PHP can be used to access COM and DCOM objects on Win32 platforms.
PHP можна використати для доступу до об'єктів COM і DCOM на платформах Win32.
</para>
<qandaset>
<qandaentry xml:id="faq.com.q1">
<question>
<para>
I have built a DLL to calculate something. Is there any way to run this DLL under PHP ?
Я зібрав DLL для обчислень. Яким чином запустити цю DLL в PHP?
</para>
</question>
<answer>
<para>
If this is a simple DLL there is no way yet to run it from PHP. If the DLL contains a COM
server you may be able to access it if it implements the IDispatch interface.
Якщо це звичайна DLL, то її поки що не запустити з PHP. Якщо DLL містить
COM сервер, ви можете мати доступ до нього, якщо він реалізував
інтерфейс IDispatch.
</para>
</answer>
</qandaentry>
@@ -26,17 +27,17 @@
<qandaentry xml:id="faq.com.q2">
<question>
<para>
What does 'Unsupported variant type: xxxx (0xxxxx)' mean ?
Що означає "Unsupported variant type: xxxx (0xxxxx)"?
</para>
</question>
<answer>
<para>
There are dozens of VARIANT types and combinations of them. Most of them are already supported but
a few still have to be implemented.
Arrays are not completely supported. Only single dimensional indexed
only arrays can be passed between PHP and COM.
If you find other types that aren't supported, please report them as a bug (if not already reported)
and provide as much information as available.
Є десятки типів VARIANT та їхніх комбінацій. Більшість з них вже
підтримуються, але кілька ще на стадії впровадження. Масиви підтримуються
не повністю. Тільки одновимірні індексовані масиви можуть передаватися між
PHP та COM. Якщо ви знайшли інші типи, що не підтримуються, повідомте,
будь ласка, про них, як про ваду (якщо вже не повідомлено) та надайте
якнайбільше інформації.
</para>
</answer>
</qandaentry>
@@ -44,15 +45,16 @@
<qandaentry xml:id="faq.com.q3">
<question>
<para>
Is it possible manipulate visual objects in PHP ?
Чи можливо керувати візуальними об'єктами в PHP?
</para>
</question>
<answer>
<para>
Generally it is, but as PHP is mostly used as a web scripting language it runs in the web servers context, thus
visual objects will never appear on the servers desktop.
If you use PHP for application scripting e.g. in conjunction with PHP-GTK there is no limitation in accessing and
manipulating visual objects through COM.
Загалом так, але оскільки PHP є мовою веб-сценаріїв, її код
запускається в контексті вебсервера, тому візуальні об'єкти ніколи не
з'являться на робочому столі серверів. Якщо ви, наприклад, використовуєте
PHP для написання програм спільно з PHP-GTK, то нема обмежень доступу або
керування візуальними об'єктами через COM.
</para>
</answer>
</qandaentry>
@@ -60,12 +62,13 @@
<qandaentry xml:id="faq.com.q4">
<question>
<para>
Can I store a COM object in a session ?
Чи я можу зберігати об'єкт COM в сесії?
</para>
</question>
<answer>
<para>
No, you can't. COM instances are treated as resources and therefore they are only available in a single script's context.
Ні, не можете. Екземпляри COM розглядаються як ресурси, тому вони доступні
лише в контексті одного сеансу.
</para>
</answer>
</qandaentry>
@@ -73,14 +76,14 @@
<qandaentry xml:id="faq.com.q5">
<question>
<para>
How can I trap COM errors?
Як я можу перехопити помилки COM?
</para>
</question>
<answer>
<para>
The COM extension throws <literal>com_exception</literal>
exceptions, which you can catch and then inspect the <literal>code</literal>
member to determine what to do next.
Розширення COM викидає виключення <literal>com_exception</literal>, які
ви можете ловити, щоб визначити і оглянути проблемну частину
<literal>коду</literal>.
</para>
</answer>
</qandaentry>
@@ -88,12 +91,12 @@
<qandaentry xml:id="faq.com.q6">
<question>
<para>
Can I generate DLL files from PHP scripts like I can in Perl ?
Чи я можу генерувати файли DLL скриптами PHP, так як це робив на Perl?
</para>
</question>
<answer>
<para>
No, unfortunately there is no such tool available for PHP.
Ні, на жаль на PHP такий інструмент недоступний.
</para>
</answer>
</qandaentry>
@@ -101,26 +104,26 @@
<qandaentry xml:id="faq.com.q7">
<question>
<para>
What does 'Unable to obtain IDispatch interface for CLSID {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}' mean ?
Що означає "Unable to obtain IDispatch interface for CLSID {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"?
</para>
</question>
<answer>
<para>
This error can have multiple reasons:
Ця помилка може бути з декількох причин:
<itemizedlist>
<listitem>
<simpara>
the CLSID is wrong
неправильний CLSID
</simpara>
</listitem>
<listitem>
<simpara>
the requested DLL is missing
необхідна DLL відсутня
</simpara>
</listitem>
<listitem>
<simpara>
the requested component doesn't implement the IDispatch interface
запитуваний компонент не реалізує інтерфейс IDispatch
</simpara>
</listitem>
</itemizedlist>
@@ -131,18 +134,18 @@
<qandaentry xml:id="faq.com.q8">
<question>
<para>
How can I run COM object from remote server ?
Як мені запускати об'єкти COM з віддаленого сервера?
</para>
</question>
<answer>
<para>
Exactly like you run local objects. You only have to pass the IP of the remote machine as second parameter to
the COM constructor.
Так само, як і локальні об'єкти. Вам лише треба передати другим параметром
конструктору COM IP віддаленої машини.
</para>
<para>
Make sure that you have set
Переконайтеся, що ви визначили
<link linkend="ini.com.allow-dcom">com.allow_dcom</link><literal>=</literal>&true;
in your &php.ini;.
у вашому &php.ini;.
</para>
</answer>
</qandaentry>
@@ -150,12 +153,13 @@
<qandaentry xml:id="faq.com.q9">
<question>
<para>
I get 'DCOM is disabled in C:\path...\scriptname.php on line 6', what can I do ?
Я отримую "DCOM is disabled in C:\path...\scriptname.php on line 6", що я
можу зробити?
</para>
</question>
<answer>
<para>
Edit your &php.ini; and set
Відредагуйте ваш &php.ini;, задавши
<link linkend="ini.com.allow-dcom">com.allow_dcom</link><literal>=</literal>&true;.
</para>
</answer>
@@ -164,27 +168,28 @@
<qandaentry xml:id="faq.com.q10">
<question>
<para>
Is it possible to load/manipulate an ActiveX object in a page with PHP ?
Чи можливо завантажувати/маніпулювати об'єктом ActiveX на сторінці за
допомогою PHP?
</para>
</question>
<answer>
<para>
This has nothing to do with PHP. ActiveX objects are loaded on client side if they are requested
by the HTML document. There is no relation to the PHP script and therefore there is no direct
server side interaction possible.
Це не має нічого спільного з PHP. Об'єкти ActiveX завантажуються у
клієнтський код за запитом документа HTML. Це не стосується скрипту PHP,
тому пряма взаємодія на стороні сервера неможлива.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.com.q11">
<question>
<para>
Is it possible to get a running instance of a component ?
Чи можливо отримати запущений екземпляр компонента?
</para>
</question>
<answer>
<para>
This is possible with the help of monikers. If you want to get multiple references to the same word instance
you can create that instance like shown:
Це можливо завдяки псевдонімам. Якщо треба отримати численні посилання на
той самий екземпляр слова, ви можете створити цей екземпляр, як показано:
</para>
<programlisting role="php">
<![CDATA[
@@ -194,23 +199,22 @@ $word = new COM("C:\docs\word.doc");
]]>
</programlisting>
<para>
This will create a new instance if there is no running instance available or it will return a handle to the
running instance, if available.
Це створить новий екземпляр, якщо запущеного немає, або поверне дескриптор
запущеного екземпляра, якщо він доступний.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.com.q12">
<question>
<para>
Is there a way to handle an event sent from COM object ?
Чи є спосіб обробки події, надісланої з об’єкта COM?
</para>
</question>
<answer>
<para>
You can define an event sink and bind it using
<function>com_event_sink</function>. You can use
<function>com_print_typeinfo</function> to have PHP generate a skeleton
for the event sink class.
Ви можете створити обробник подій і прив'язати його, використавши
<function>com_event_sink</function>. Щоб PHP генерував скелет для класу
приймача подій, є функція <function>com_print_typeinfo</function>.
</para>
</answer>
</qandaentry>
@@ -218,14 +222,16 @@ $word = new COM("C:\docs\word.doc");
<qandaentry xml:id="faq.com.q13">
<question>
<para>
I'm having problems when trying to invoke a method of a COM object
which exposes more than one interface. What can I do ?
Не можу викликати метод об'єкта COM, який реалізує більше ніж один
інтерфейс. Що я можу зробити?
</para>
</question>
<answer>
<para>
The answer is as simple as unsatisfying. I don't know exactly but i think you can do nothing.
If someone has specific information about this, please let <link xlink:href="mailto:&email.harald;">me</link> know :)
Відповідь настільки проста, наскільки і незадовільна. Невідомо, чому так,
але не можна нічого з цим вдіяти. Якщо хтось має потрібну інформацію з
цього приводу, будь ласка,
<link xlink:href="mailto:&email.harald;">дайте знати</link> :)
</para>
</answer>
</qandaentry>
@@ -233,13 +239,13 @@ $word = new COM("C:\docs\word.doc");
<qandaentry xml:id="faq.com.q14">
<question>
<para>
So PHP works with COM, how about COM+ ?
Отже, PHP працює з COM, як щодо COM+ ?
</para>
</question>
<answer>
<para>
COM+ extends COM by a framework for managing components through MTS and MSMQ but there is nothing special that
PHP has to support to use such components.
COM+ розширює COM платформою для керування компонентами через MTS і MSMQ,
але в цьому немає нічого особливого, аби PHP мав підтримку цього продукту.
</para>
</answer>
</qandaentry>
@@ -247,16 +253,16 @@ $word = new COM("C:\docs\word.doc");
<qandaentry xml:id="faq.com.q15">
<question>
<para>
If PHP can manipulate COM objects, can we imagine to use
MTS to manage components resources, in conjunction with PHP ?
Якщо PHP може керувати об'єктами COM, чи можемо ми уявити використання MTS
для керування ресурсами компонентів у поєднанні з PHP?
</para>
</question>
<answer>
<para>
PHP itself doesn't handle transactions yet. Thus if an error
occurs no rollback is initiated. If you use components that
support transactions you will have to implement the
transaction management yourself.
PHP сам ще не обробляє транзакції. Таким чином, якщо виникає помилка,
відкочування не починається. Якщо ви використовуєте компоненти, які
підтримують транзакції, вам треба власноруч реалізувати управління
транзакціями.
</para>
</answer>
</qandaentry>

View File

@@ -1,144 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: b8e1b1357def73f310c9f7405035b3acc0cb1eaf Maintainer: mproshchuk Status: wip -->
<!-- EN-Revision: b8e1b1357def73f310c9f7405035b3acc0cb1eaf Maintainer: mproshchuk Status: ready -->
<chapter xml:id="faq.databases" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Database issues</title>
<titleabbrev>Database issues</titleabbrev>
<title>Проблеми баз даних</title>
<titleabbrev>Проблеми баз даних</titleabbrev>
<para>
This section holds common questions about relation between
PHP and databases. Yes, PHP can access virtually any
database available today.
Цей розділ містить поширені питання про зв'язок PHP з базами даних. Так, PHP
може мати віртуальний доступ до усіх відомих на сьогодні баз даних.
</para>
<qandaset>
<qandaentry xml:id="faq.databases.mssql">
<question>
<para>
I heard it's possible to access Microsoft SQL Server from PHP. How?
Я чув, що можливо мати доступ до Microsoft SQL Server з PHP. Як?
</para>
</question>
<answer>
<para>
On Unix machines you can use <link linkend="ref.pdo-odbc">PDO_ODBC</link>
or the <link linkend="book.uodbc">Unified ODBC API</link>.
На машинах Unix ви можете використовувати
<link linkend="ref.pdo-odbc">PDO_ODBC</link> або
<link linkend="book.uodbc">Уніфікований ODBC API</link>.
</para>
<para>
On Windows machines you can also use <link linkend="ref.pdo-sqlsrv">PDO_SQLSRV</link>
or <link linkend="book.sqlsrv">SQLSRV</link>.
А на машинах Windows ви можете використовувати
<link linkend="ref.pdo-sqlsrv">PDO_SQLSRV</link> або
<link linkend="book.sqlsrv">SQLSRV</link>.
</para>
<para>
Also see the answer to the next question.
Також прочитайте відповідь на наступне питання.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.databases.access">
<question>
<para>Can I access Microsoft Access databases?</para>
<para>Чи можу я отримати доступ до баз даних Microsoft Access?</para>
</question>
<answer>
<para>
If you are running PHP on a Unix box and want to talk to MS Access
on a Windows box you will need Unix ODBC drivers.
<link xlink:href="&url.openlink;">OpenLink Software</link> has Unix-based
ODBC drivers that can do this.
Якщо ви запускаєте PHP в Unix і хочете зв'язуватися з MS Access у Windows,
потрібні драйвери Unix ODBC.
<link xlink:href="&url.openlink;">OpenLink Software</link> має драйвери
ODBC на основі Unix, які можуть це зробити.
</para>
<para>
Another alternative is to use an SQL server that has
Windows ODBC drivers and use that to store the data, which you can
then access from Microsoft Access (using ODBC) and PHP (using the
built in drivers), or to use an intermediary file format that Access
and PHP both understand, such as flat files or dBase databases.
On this point Tim Hayes from OpenLink software writes:
Інший спосіб — це використати для зберігання даних SQL-сервер, що має ODBC
драйвери для Windows, який буде доступним з Microsoft Access (з
використанням ODBC) та PHP (використовуючи вбудовані драйвери) або
використовувати проміжний формат файлу, зрозумілий для Access та PHP,
наприклад текстові файли або бази даних dBase. З цього приводу Тім Гейс з
OpenLink Software пише:
<blockquote>
<para>
Using another database as an intermediary is not a good idea, when you can
use ODBC from PHP straight to your database - i.e. with OpenLink's drivers. If
you do need to use an intermediary file format, OpenLink have now released
Virtuoso (a virtual database engine) for NT, Linux and other Unix platforms.
Please visit our <link xlink:href="&url.openlink;">website</link> for a free download.
Використання іншої бази даних як проміжної — погана ідея, коли ви можете
застосовувати ODBC з PHP прямо до вашої бази даних - тобто з драйверами
OpenLink. Якщо у вас є потреба у проміжному файловому форматі, OpenLink
випустив Virtuoso (віртуальний рушій бази даних) для NT, Linux та інших
платформ Unix. Відвідайте, будь ласка, наш
<link xlink:href="&url.openlink;">вебсайт</link> для вільного
звантаження.
</para>
</blockquote>
</para>
<para>
One option that has proved successful is to use MySQL and its
MyODBC drivers on Windows and synchronizing the databases. Steve Lawrence
writes:
Є спосіб, що заявлений, як успішний, це MySQL з власними драйверами MyODBC
для Windows та синхронізація баз даних. Стів Лоуренс пише:
</para>
<para>
<itemizedlist>
<listitem>
<simpara>
Install MySQL on your platform according to instructions with MySQL.
Latest available from <link xlink:href="&url.mysql;">&url.mysql;</link>
No special configuration required except when you set up a database, and configure the
user account, you should put % in the host field, or the host name of the
Windows computer you wish to access MySQL with. Make a note of your server
name, username, and password.
Установіть MySQL на вашу платформу згідно з інструкціями до MySQL.
Найновіша версія доступна на
<link xlink:href="&url.mysql;">&url.mysql;</link>. Жодних особливих
налаштувань при встановленні не потрібно, за винятком того, що потрібно
буде вписати в поле "host" символ % або назву хоста комп’ютера з ОС
Windows, з якого ви бажаєте отримати доступ до MySQL. Занотуйте собі
назву вашого сервера, назву БД, ім'я користувача і пароль.
</simpara>
</listitem>
<listitem>
<simpara>
Download the MyODBC for Windows driver from the MySQL site.
Install it on your Windows machine. You can test the operation with
the utilities included with this program.
Звантажте драйвер MyODBC для Windows сайту MySQL. Установіть його на
вашу машину Windows. Можете перевірити операції інструментом, що
міститься в цій програмі.
</simpara>
</listitem>
<listitem>
<simpara>
Create a user or system dsn in your ODBC administrator, located in the
control panel. Make up a dsn name, enter your hostname, user name, password,
port, etc for you MySQL database configured in step 1.
Створіть користувацький або системний dsn у "адміністратор ODBC",
розташованій на панелі управління. заповніть назву dsn, хост, ім'я
користувача, пароль, порт та інші дані про вашу базу даних MySQL, яку
ви налаштовували на першому етапі.
</simpara>
</listitem>
<listitem>
<simpara>
Install Access with a full install, this makes sure you get the proper
add-ins... at the least you will need ODBC support and the linked table
manager.
Установіть Access повністю — це гарантує, що ви отримаєте належні
надбудови... щонайменше вам потрібна підтримка ODBC та менеджер
прив'язаних таблиць.
</simpara>
</listitem>
<listitem>
<simpara>
Now the fun part! Create a new access database. In the table
window right click and select Link Tables, or under the file
menu option, select Get External Data and then Link Tables.
When the file browser box comes up, select files of type: ODBC.
Select System dsn and the name of your dsn created in step 3.
Select the table to link, press OK, and presto! You can now
open the table and add/delete/edit data on your MySQL server!
You can also build queries, import/export tables to MySQL,
build forms and reports, etc.
А зараз — весела частина! Створіть нову базу даних у Access. У вікні
таблиці натисніть праву клавішу мишки та оберіть "Прив'язати таблиці"
або в пункті меню "Файл" оберіть "Отримати завнішні дані", а потім —
"Прив'язати таблиці". Коли з’явиться вікно браузера файлів, оберіть
файли типу ODBC. Оберіть "Системна dsn" та назву dsn, створену в кроці
3. Виберіть таблицю, яку необхідно прив'язати, натисніть "OK" і готово!
Тепер ви можете відкрити таблицю і додавати, видаляти, редагувати дані
на вашому сервері MySQL! Ви також можете будувати запити,
імпортувати/експортувати таблиці до/з MySQL, будувати форми і звіти,
багато іншого.
</simpara>
</listitem>
</itemizedlist>
</para>
<para>
Tips and Tricks:
Поради та підказки:
<itemizedlist>
<listitem>
<simpara>
You can construct your tables in Access and export them
to MySQL, then link them back in. That makes table
creation quick.
Ви можете будувати ваші таблиці в Access та експортувати їх до MySQL,
потім прив'язувати їх знову. Це робить створення таблиць швидшим.
</simpara>
</listitem>
<listitem>
<simpara>
When creating tables in Access, you must have a primary
key defined in order to have write access to the table in
access. Make sure you create a primary key in MySQL before
linking in access
Під час створення таблиць у Access, додавайте первинний ключ, щоб мати
право на запис у таблицю через Access. Переконайтеся, що створили
первинний ключ в MySQL перед прив'язуванням в Access.
</simpara>
</listitem>
<listitem>
<simpara>
If you change a table in MySQL, you have to re-link it
in Access. Go to tools&gt;add-ins&gt;linked table manager,
cruise to your ODBC DSN, and select the table to re-link
from there. you can also move your dsn source around there,
just hit the always prompt for new location checkbox before
pressing OK.
Якщо ви змінили таблицю в MySQL, вам треба прив'язати її знову в
Access. Перейдіть до "засоби&gt;надбудови&gt;менеджер прив'язаних
таблиць", прокрутіть до ваших ODBC DSN, оберіть звідти таблицю для
повторного прив'язування. Ви також можете перемістити туди своє джерело
dsn, просто поставивши галочку "Завжди запитувати нове розташування",
перш ніж натиснути OK.
</simpara>
</listitem>
</itemizedlist>

View File

@@ -1,73 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 9a07a968506c613b3e9f6e508edaf0801061aa25 Maintainer: mproshchuk Status: wip -->
<!-- EN-Revision: 9a07a968506c613b3e9f6e508edaf0801061aa25 Maintainer: mproshchuk Status: ready -->
<chapter xml:id="faq.general" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>General Information</title>
<titleabbrev>General Information</titleabbrev>
<title>Загальні відомості</title>
<titleabbrev>Загальні відомості</titleabbrev>
<para>
This section holds the most general questions about PHP:
what it is and what it does.
Цей розділ містить найзагальніші питання про PHP: що це таке і що робить.
</para>
<qandaset>
<qandaentry xml:id="faq.general.what">
<question>
<para>What is PHP?</para>
<para>Що таке PHP?</para>
</question>
<answer>
<para>
From the <link linkend="preface">preface of the manual</link>:
З <link linkend="preface">Передмови посібника</link>:
</para>
<para>
PHP is an HTML-embedded scripting language. Much of
its syntax is borrowed from C, Java and Perl with a couple of unique
PHP-specific features thrown in. The goal of the language is to
allow web developers to write dynamically generated pages quickly.
PHP — це скриптова мова, чий код можна вписувати в HTML. Велика частина її
синтаксису запозичена у C, Java і Perl, з додаванням кількох унікальних
особливостей PHP. Мета мови — дати змогу веброзробникам швидко розробляти
динамічні сторінки.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.general.acronym">
<question>
<para>What does PHP stand for?</para>
<para>Що означає "PHP"?</para>
</question>
<answer>
<para>
PHP stands for <emphasis>PHP: Hypertext Preprocessor</emphasis>.
This confuses many people because the first word of the acronym is
the acronym. This type of acronym is called a recursive acronym.
For more information, the curious can visit
<link xlink:href="&url.foldoc;">Free On-Line Dictionary of Computing</link>
or the
<link xlink:href="&url.wiki.recursive-acronym;">Wikipedia entry on
recursive acronyms</link>.
PHP означає <emphasis>PHP: Hypertext Preprocessor</emphasis>
(гіпертекстовий препроцесор). Це спантеличує багатьох, бо перше слово
акроніму і є цим акронімом. Такий вид акронімів називається рекурсивним.
Охочі дізнатися докладніше можуть відвідати
<link xlink:href="&url.foldoc;">Безкоштовний онлайн-словник з
обчислювальної техніки</link> або
<link xlink:href="&url.wiki.recursive-acronym;">запис у Вікіпедії про
рекурсивні акроніми</link>.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.general.relation-versions">
<question>
<para>What is the relation between the versions?</para>
<para>Який зв'язок між версіями?</para>
</question>
<answer>
<para>
PHP/FI 2.0 is an early and no longer supported version of PHP. PHP 3
is the successor to PHP/FI 2.0 and is a lot nicer. PHP 8 is the current
generation of PHP, which uses the Zend
engine 4 which, among other things, offers many additional
<link linkend="language.oop5">OOP</link> features.
PHP/FI 2.0 — стара і більше не підтримувана версія PHP. PHP 3 є
наступницею PHP/FI 2.0 і набагато кращою. PHP 8 є сучасним поколінням PHP,
яке використовує Zend engine 4, який, серед іншого, пропонує багато
додаткових можливостей <link linkend="language.oop5">ООП</link>.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.general.running-concurent">
<question>
<para>Can I run several versions of PHP at the same time?</para>
<para>Чи можу я запускати кілька версій PHP водночас?</para>
</question>
<answer>
<para>
Yes. See the <filename>INSTALL</filename> file that is included
in the PHP source distribution.
Так. Прочитайте файл <filename>INSTALL</filename>, який є у дистрибутиві
PHP.
</para>
</answer>
</qandaentry>
@@ -75,18 +73,17 @@
<qandaentry xml:id="faq.general.bug">
<question>
<para>
I think I found a bug! Who should I tell?
Здається, я знайшов ваду! Кому я маю сказати?
</para>
</question>
<answer>
<para>
You should go to the PHP Bug Database and make sure the bug
isn't a known bug. If you don't see it in the database, use
the reporting form to report the bug. It is important to use
the bug database instead of just sending an email to one of the
mailing lists because the bug will have a tracking number assigned
and it will then be possible for you to go back later and check
on the status of the bug. The bug database can be found at
Вам потрібно зайти на PHP Bug Database та упевнитись, що про дану ваду ще
не повідомлено. Якщо ви не бачите її в базі даних, використайте форму для
надсилання звітів, щоб повідомити про ваду. Важливо використовувати базу
даних, щоб ваді призначили номер відстеження, а не просто надіслати
електронного листа комусь з списків розсилки. Так ви зможете повернутися
пізніше і перевірити стан вади. База даних про вади знаходиться за адресою
<link xlink:href="&url.php.bugs;">&url.php.bugs;</link>.
</para>
</answer>

View File

@@ -1,42 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 8b647de71ab443cb2784a82902bfc87728d587ae Maintainer: mproshchuk Status: wip -->
<!-- EN-Revision: 8b647de71ab443cb2784a82902bfc87728d587ae Maintainer: mproshchuk Status: ready -->
<chapter xml:id="faq.html" xmlns="http://docbook.org/ns/docbook">
<title>PHP and HTML</title>
<titleabbrev>PHP and HTML</titleabbrev>
<title>PHP та HTML</title>
<titleabbrev>PHP та HTML</titleabbrev>
<para>
PHP and HTML interact a lot: PHP can generate HTML, and HTML
can pass information to PHP. Before reading these faqs, it's
important you learn how to retrieve <link linkend="language.variables.external">
variables from external sources</link>. The manual page on
this topic includes many examples as well.
PHP та HTML глибоко взаємодіють: PHP може генерувати HTML, а HTML може
передавати інформацію до PHP. Перед читанням цих ЧаПів важливо, щоб ви
навчилися отримувати <link linkend="language.variables.external">змінні зі
зовнішніх джерел</link>. Сторінка посібника на цю тему також містить багато
прикладів.
</para>
<qandaset>
<qandaentry xml:id="faq.html.encoding">
<question>
<para>
What encoding/decoding do I need when I pass a value through a form/URL?
Яке кодування/декодування мені потрібно робити, коли я передаю значення
через форму або URL?
</para>
</question>
<answer>
<para>
There are several stages for which encoding is important. Assuming that
you have a <type>string</type> <varname>$data</varname>, which contains
the string you want to pass on in a non-encoded way, these are the
relevant stages:
Є кілька етапів, для яких кодування є важливим. Припустимо, що ви маєте
<type>string</type> <varname>$data</varname>, яка містить рядок, який ви
хочете передати незакодованим. Це виглядатиме таким чином:
<itemizedlist>
<listitem>
<para>
HTML interpretation. In order to specify a random string, you
<emphasis>must</emphasis> include it in double quotes, and
<function>htmlspecialchars</function> the whole value.
HTML-інтерпретація. Задаючи випадковий рядок, ви
<emphasis>мусите</emphasis> помістити його у подвійні лапки та обробити
таке значення функцією <function>htmlspecialchars</function>.
</para>
</listitem>
<listitem>
<para>
URL: A URL consists of several parts. If you want your data to be
interpreted as one item, you <emphasis>must</emphasis> encode it with
URL: URL складається з частин. Аби певні дані сприймалися, як частина
URL, ви <emphasis>мусите</emphasis> закодувати їх за допомогою
<function>urlencode</function>.
</para>
</listitem>
@@ -44,7 +44,7 @@
</para>
<para>
<example>
<title>A hidden HTML form element</title>
<title>Прихований елемент HTML-форми</title>
<programlisting role="php">
<![CDATA[
<?php
@@ -55,16 +55,15 @@
</example>
<note>
<simpara>
It is wrong to <function>urlencode</function>
<varname>$data</varname>, because it's the browsers responsibility to
<function>urlencode</function> the data. All popular browsers do that
correctly. Note that this will happen regardless of the method (i.e.,
GET or POST). You'll only notice this in case of GET request though,
because POST requests are usually hidden.
Не можна <varname>$data</varname> обробляти функцією
<function>urlencode</function> тому, що за це відповідає браузер. Усі
популярні браузери роблять це правильно, незалежно від методу (себто GET
або POST). Це помітно у випадку GET-запиту, бо POST-запити зазвичай
приховані.
</simpara>
</note>
<example>
<title>Data to be edited by the user</title>
<title>Дані, що редагуються користувачем</title>
<programlisting role="php">
<![CDATA[
<?php
@@ -77,18 +76,17 @@
</example>
<note>
<simpara>
The data is shown in the browser as intended, because the browser will
interpret the HTML escaped symbols.
Ці дані браузер зображує належним чином тому, що інтерпретує екрановані
HTML-символи.
</simpara>
<simpara>
Upon submitting, either via GET or POST, the data will be urlencoded
by the browser for transferring, and directly urldecoded by PHP. So in
the end, you don't need to do any urlencoding/urldecoding yourself,
everything is handled automagically.
Після підтвердження форми через GET або POST, браузер закодує дані в URL
для передавання до PHP, який їх розкодує. Тож вам не треба самостійно
щось кодувати, все обробиться автоматично.
</simpara>
</note>
<example>
<title>In a URL</title>
<title>В URL</title>
<programlisting role="php">
<![CDATA[
<?php
@@ -100,24 +98,25 @@
</example>
<note>
<simpara>
In fact you are faking a HTML GET request, therefore it's necessary to
manually <function>urlencode</function> the data.
Якщо ви модулюєте GET-запит, необхідно власноруч застосувати
<function>urlencode</function> до даних.
</simpara>
</note>
<note>
<simpara>
You need to <function>htmlspecialchars</function> the whole URL, because the
URL occurs as value of an HTML-attribute. In this case, the browser
will first un-<function>htmlspecialchars</function> the value, and then pass
the URL on. PHP will understand the URL correctly, because you
<function>urlencode</function>d the data.
Вам потрібно обробити всю URL функцією
<function>htmlspecialchars</function>, щоб URL не сприйнялася, як код
HTML. В такому разі браузер виконає зворотню до
<function>htmlspecialchars</function> дію стосовно значення та сприйме
його, як URL. PHP зрозуміє URL коректно, бо ви обробили дані функцією
<function>urlencode</function>.
</simpara>
<simpara>
You'll notice that the <literal>&amp;</literal> in the URL is replaced
by <literal>&amp;amp;</literal>. Although most browsers will recover
if you forget this, this isn't always possible. So even if your URL is
not dynamic, you <emphasis>need</emphasis> to
<function>htmlspecialchars</function> the URL.
Зауважте, що символ <literal>&amp;</literal> в URL замінено на
<literal>&amp;amp;</literal>. Здебільшого браузери відновлять його, якщо
ви забудете, але не завжди. Тож навіть якщо ваша URL не динамічна, вам
<emphasis>потрібно</emphasis> застосувати
<function>htmlspecialchars</function> до URL.
</simpara>
</note>
</para>
@@ -128,36 +127,35 @@
<qandaentry xml:id="faq.html.form-image">
<question>
<para>
I'm trying to use an &lt;input type="image"&gt; tag, but
the <varname>$foo.x</varname> and <varname>$foo.y</varname> variables
aren't available. <varname>$_GET['foo.x']</varname> isn't existing
either. Where are they?
Я намагаюся використати тег &lt;input type="image"&gt;, але змінні
<varname>$foo.x</varname> і <varname>$foo.y</varname> недоступні.
<varname>$_GET['foo.x']</varname> не існує теж. Де вони?
</para>
</question>
<answer>
<para>
When submitting a form, it is possible to use an image instead of
the standard submit button with a tag like:
Замість звичної кнопки для надсилання форми можна використовувати
зображення за допомогою тегу:
<programlisting role="html">
<![CDATA[
<input type="image" src="image.gif" name="foo" />
]]>
</programlisting>
When the user clicks somewhere on the image, the accompanying form
will be transmitted to the server with two additional variables:
Коли користувач клацне десь на зображення, така форма буде передана
серверу з двома додатковими змінними:
<varname>foo.x</varname> and <varname>foo.y</varname>.
</para>
<para>
Because <varname>foo.x</varname> and <varname>foo.y</varname> would
make invalid variable names in PHP, they are automagically converted to
<varname>foo_x</varname> and <varname>foo_y</varname>. That is, the
periods are replaced with underscores. So, you'd access these variables
like any other described within the section on retrieving
<link linkend="language.variables.external">variables from external
sources</link>. For example, <varname>$_GET['foo_x']</varname>.
Оскільки <varname>foo.x</varname> і <varname>foo.y</varname> містять в
назвах недозволені символи, вони автоматично перейменуються на
<varname>foo_x</varname> і <varname>foo_y</varname>. Тобто крапки
заміняться на підкреслення. Таким чином, ви матимете доступ до цих
змінних, як і до будь-яких інших, описаних в розділі про отримання
<link linkend="language.variables.external">змінних з зовнішніх
джерел</link>. До прикладу, <varname>$_GET['foo_x']</varname>.
<note>
<para>
Spaces in request variable names are converted to underscores.
Пробіли в назвах змінних запиту перетворюються на підтвердження.
</para>
</note>
</para>
@@ -166,14 +164,13 @@
<qandaentry xml:id="faq.html.arrays">
<question>
<para>How do I create arrays in a HTML &lt;form&gt;?</para>
<para>Як я можу створити масиви в HTML-тегові &lt;form&gt;?</para>
</question>
<answer>
<para>
To get your &lt;form&gt; result sent as an
<link linkend="language.types.array">array</link> to your PHP script
you name the &lt;input&gt;, &lt;select&gt; or &lt;textarea&gt;
elements like this:
Для отримання в скрипті PHP надісланого результату як
<link linkend="language.types.array">array</link>, треба називати атрибути
тегів &lt;input&gt;, &lt;select&gt; і &lt;textarea&gt; за зразком:
<programlisting role="html">
<![CDATA[
<input name="MyArray[]" />
@@ -182,9 +179,8 @@
<input name="MyArray[]" />
]]>
</programlisting>
Notice the square brackets after the variable name, that's what
makes it an array. You can group the elements into different arrays
by assigning the same name to different elements:
Квадратні дужки після назви змінної позначають її як масив. Ви можете
групувати елементи в різні масиви, назвавши однаково різні елементи:
<programlisting role="html">
<![CDATA[
<input name="MyArray[]" />
@@ -193,9 +189,8 @@
<input name="MyOtherArray[]" />
]]>
</programlisting>
This produces two arrays, MyArray and MyOtherArray, that gets sent
to the PHP script. It's also possible to assign specific keys
to your arrays:
Такий код створює два масиви "MyArray" та "MyOtherArray", які
надсилаються до скрипта PHP. Також можливо називати ключі масивів:
<programlisting role="html">
<![CDATA[
<input name="AnotherArray[]" />
@@ -204,22 +199,22 @@
<input name="AnotherArray[phone]" />
]]>
</programlisting>
The AnotherArray array will now contain the keys 0, 1, email and phone.
Масив "AnotherArray" міститиме ключі 0, 1, "email" і "phone".
</para>
<para>
<note>
<para>
Specifying array keys is optional in HTML. If you do not specify
the keys, the array gets filled in the order the elements appear in
the form. Our first example will contain keys 0, 1, 2 and 3.
Визначення ключів масиву необов'язкове у HTML. Якщо ви не визначите їх,
масив заповниться в тому порядку, в якому елементи розташовані у формі.
Перший приклад міститиме ключі 0, 1, 2 та 3.
</para>
</note>
</para>
<para>
See also
<link linkend="ref.array">Array Functions</link> and
<link linkend="language.variables.external">Variables From External
Sources</link>.
Докладніше:
<link linkend="ref.array">Функції для масивів</link>,
<link linkend="language.variables.external">Змінні з зовнішніх
джерел</link>.
</para>
</answer>
</qandaentry>
@@ -227,49 +222,48 @@
<qandaentry xml:id="faq.html.select-multiple">
<question>
<para>
How do I get all the results from a select multiple HTML tag?
Як мені отримати всі вибрані варіанти з множинного виду HTML-тегу
&lt;select&gt;?
</para>
</question>
<answer>
<para>
The select multiple tag in an HTML construct allows users to
select multiple items from a list. These items are then passed
to the action handler for the form. The problem is that they
are all passed with the same widget name. I.e.
Множинний вид тегу &lt;select&gt; в HTML дозволяє користувачам обрати
кілька елементів з списку. Далі ці елементи передаються до обробника
дій форми. Проблема в тому, що вони всі передаються з однаковою назвою.
Тобто:
<programlisting role="html">
<![CDATA[
<select name="var" multiple="yes">
]]>
</programlisting>
Each selected option will arrive at the action handler as:
Обрані варіанти надійдуть до обробника дій таким чином:
<programlisting>
var=option1
var=option2
var=option3
</programlisting>
Each option will overwrite the contents of the previous
<varname>$var</varname> variable. The solution is to use
PHP's "array from form element" feature. The following
should be used:
Кожен наступний обраний варіант буде переписувати попередній вміст змінної
<varname>$var</varname>. Рішенням є використати можливість PHP робити
"масив з елемента форми". Слід писати наступне:
<programlisting role="html">
<![CDATA[
<select name="var[]" multiple="yes">
]]>
</programlisting>
This tells PHP to treat <varname>$var</varname> as an array and
each assignment of a value to var[] adds an item to the array.
The first item becomes <varname>$var[0]</varname>, the next
<varname>$var[1]</varname>, etc. The <function>count</function>
function can be used to determine how many options were selected,
and the <function>sort</function> function can be used to sort
the option array if necessary.
Тоді PHP розглядатиме <varname>$var</varname> як масив, і кожне
задавання значення var[] додаватиме елемент до масиву. Перший елемент
стане <varname>$var[0]</varname>, наступний — <varname>$var[1]</varname>,
і так далі. Функція <function>count</function> може бути використана, щоб
визначити кількість обраних варіантів, а функція <function>sort</function>
— для впорядкування масиву варіантів, якщо необхідно.
</para>
<para>
Note that if you are using JavaScript the <literal>[]</literal>
on the element name might cause you problems when you try to
refer to the element by name. Use it's numerical form element
ID instead, or enclose the variable name in single quotes and
use that as the index to the elements array, for example:
Майте, на увазі, якщо використовуєте JavaScript, <literal>[]</literal> в
назві елемента може спровокувати проблеми при намаганні звернутися до
елемента за атрибутом "name". Краще використати атрибут "id" або вкласти
назву змінної в одинарні лапки та використовувати її як індекс масиву
елементів. Наприклад:
<programlisting>
variable = document.forms[0].elements['var[]'];
</programlisting>
@@ -280,39 +274,36 @@ variable = document.forms[0].elements['var[]'];
<qandaentry xml:id="faq.html.javascript-variable">
<question>
<para>
How can I pass a variable from Javascript to PHP?
Як мені передати змінну з Javascript до PHP?
</para>
</question>
<answer>
<para>
Since Javascript is (usually) a client-side technology, and
PHP is (usually) a server-side technology, and since HTTP is a
"stateless" protocol, the two languages cannot directly share
variables.
Оскільки код Javascript (зазвичай) виконує клієнт, а код PHP (зазвичай) —
сервер, а HTTP — це протокол "без стану", дві мови не мають функціоналу
прямого обміну змінними.
</para>
<para>
It is, however, possible to pass variables between the two.
One way of accomplishing this is to generate Javascript code
with PHP, and have the browser refresh itself, passing specific
variables back to the PHP script. The example below shows
precisely how to do this -- it allows PHP code to capture screen
height and width, something that is normally only possible on
the client side.
Проте є спосіб передавати змінні між ними двома. Перший шлях — згенерувати
код Javascript в PHP, оновити браузер, передати потрібні змінні назад до
скрипта PHP. Приклад нижче показує, як достеменно це зробити — він
дозволяє коду PHP отримати висоту і ширину екрану, що за нормальних умов
можливо тільки на стороні клієнта.
</para>
<para>
<example>
<title>Generating Javascript with PHP</title>
<title>Генерування Javascript в PHP</title>
<programlisting role="php">
<![CDATA[
<?php
if (isset($_GET['width']) AND isset($_GET['height'])) {
// output the geometry variables
echo "Screen width is: ". $_GET['width'] ."<br />\n";
echo "Screen height is: ". $_GET['height'] ."<br />\n";
// Вивести геометричні змінні
echo "Ширина екрана: ". $_GET['width'] ."<br />\n";
echo "Висота екрана: ". $_GET['height'] ."<br />\n";
} else {
// pass the geometry variables
// (preserve the original query string
// -- post variables will need to handled differently)
// Передати геометричні змінні
// (підготувати рядок запиту
// — з методом POST змінні треба обробляти інакше)
echo "<script language='javascript'>\n";
echo " location.href=\"${_SERVER['SCRIPT_NAME']}?${_SERVER['QUERY_STRING']}"

View File

@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: ba08db8805ddb14cbab613c893dd47eacbda22f2 Maintainer: ktretyak Status: ready -->
<!-- $Revision$ -->
<!-- EN-Revision: 8e732e84a1425cf0ab3a5b0da8fe113c7a6da85e Maintainer: mproshchuk Status: ready -->
<chapter xml:id="faq.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Встановлення</title>
<titleabbrev>Встановлення</titleabbrev>
<para>
Цей розділ містить загальні питання по встановленню PHP. PHP доступна майже
для будь-яких Операційних Систем (можливо лише за виключенням MacOS перед
OSX), та для більшості веб-серверів.
для будь-яких операційних систем та для більшості вебсерверів.
</para>
<para>
Щоб встановити PHP, пройдіть кроки описані в розділі <xref linkend="install"/>.
@@ -24,11 +23,11 @@
<answer>
<para>
PHP виконує функції своєрідного клея. Цей клей використовується щоб
створювати класні веб-застосунки, з'єднуючи дюжину сторонніх бібліотек разом
створювати класні вебзастосунки, з'єднуючи дюжину сторонніх бібліотек разом
та створюючи враження єдиного злагодженого цілого, при використанні
інтуїтивно-зрозумілого та легкого для навчання інтерфейсу мови. Гнучкість
та потужність PHP спирається на стабільність та надійність базової
платформи. Потрібно щоб працювала ОС, працював веб-сервер, та працювали
платформи. Потрібно щоб працювала ОС, працював вебсервер, та працювали
сторонні бібліотеки з'єднані разом. Якщо будь-хто з них зупинеться, то для
PHP потрібен спосіб для виявлення цієї проблеми та швидкого виправлення.
Коли ви робите звичайні умови розробки більш складними, при цьому не
@@ -69,7 +68,7 @@
</programlisting>
<para>
У Windows початково, шлях для &php.ini;, веде до директорії Windows.
Якщо ви використовуєте веб-сервер Apache, файл &php.ini;
Якщо ви використовуєте вебсервер Apache, файл &php.ini;
спочатку шукається в директорії, де встановлено Apache, наприклад в
<filename>c:\program files\apache group\apache</filename>. В такому разі,
ви можете мати кілька різних файлів &php.ini; для різних версій Apache
@@ -222,9 +221,9 @@ AddType application/x-httpd-php .php
</question>
<answer>
<para>
Прогляньте сирцевий код (view source) у веб-браузері, і ви мабуть побачите
сирцевий код PHP-скрипта. Це означає, що веб-сервер не відправляє скрипт до
PHP-інтерпритатора. Тобто є якісь помилки в конфігурації веб-сервера, то ж
Прогляньте код (view source) у браузері, і ви мабуть побачите
початковий код PHP-скрипта. Це означає, що вебсервер не відправляє скрипт до
PHP-інтерпретатора. Тобто є якісь помилки в конфігурації вебсервера, то ж
двічі перевірте цю конфігурацію, дотримуючись інструкцій встановлення PHP.
</para>
</answer>
@@ -234,12 +233,12 @@ AddType application/x-httpd-php .php
<question>
<para>
Unix/Windows: Я встановив PHP, але коли намагаюсь викликати PHP-скрипт
через веб-браузер, то отримую помилку сервера 500.
через браузер, то отримую помилку сервера 500.
</para>
</question>
<answer>
<para>
Щось помилкове стається, коли веб-сервер намагається запустити PHP. Щоб
Щось помилкове стається, коли вебсервер намагається запустити PHP. Щоб
побачити зрозумілі повідомлення помилок, з командного рядка, змініть
поточну директорію на ту, де знаходиться виконавчий файл PHP
(у Windows це <filename>php.exe</filename>) та запустіть
@@ -247,7 +246,7 @@ AddType application/x-httpd-php .php
відповідне повідомлення помилки, яке дасть вам уявлення "що робити далі".
Якщо ж вам видається повен екран HTML-коду (що є виводом функції
<function>phpinfo</function>), то PHP працює справно, і проблема можливо
стосується конфігурації веб-сервера, яку вам потрібно двічі перевірити.
стосується конфігурації вебсервера, яку вам потрібно двічі перевірити.
</para>
</answer>
</qandaentry>
@@ -269,7 +268,7 @@ AddType application/x-httpd-php .php
<para>
Це повідомлення насправді стосується не PHP, а клієнтської бібліотеки MySQL.
В деяких випадках потрібно <option role="configure">--with-zlib</option>,
а в деяких - ні. Дана проблема згадана в ЧАПі MySQL.
а в деяких - ні. Дана проблема згадана в ЧаПі MySQL.
</para>
</answer>
</qandaentry>
@@ -278,7 +277,7 @@ AddType application/x-httpd-php .php
<question>
<para>
Windows: Я встановив PHP, але коли намагаюсь доступитись до PHP-скриптів
через веб-браузер, то отримую таку помилку:
через веббраузер, то отримую таку помилку:
<screen>
<![CDATA[
cgi error:
@@ -317,11 +316,11 @@ cgi error:
<listitem>
<simpara>
Файла зі скриптом не існує (або, можливо, він не там, де ви його уявляєте,
по відношенню до кореневої директорії вашого веб-сервера). Зауважте, що
по відношенню до кореневої директорії вашого вебсервера). Зауважте, що
в IIS ви можете попастись на це повідомлення, якщо поставите галочку
'check file exists' (перевіряти наявність файла) під час налаштування
співставлення скриптів (їх мапінгу) в Менеджері Internet Services.
Насправді, якщо файлу зі скриптом не існує, то веб-сервер повертатиме 404
Насправді, якщо файлу зі скриптом не існує, то вебсервер повертатиме 404
помилку. Також існує додаткова перевага в тому, що IIS буде виконувати
будь-яку автентифікацію, яка базується на NTLanMan-дозволах для файлів
зі скриптами.
@@ -371,8 +370,8 @@ cgi error:
<para>
Оскільки початково встановлено <literal>1</literal>, то дуже важливо,
щоб ви переконались на 100%, що буде читатись коректний файл &php.ini;.
Читайте детальніше в
<link linkend="faq.installation.findphpini">цьому пункті ЧАПу</link>.
Читайте докладніше в
<link linkend="faq.installation.findphpini">цьому пункті ЧаПів</link>.
</para>
</answer>
</qandaentry>
@@ -396,7 +395,7 @@ cgi error:
</para>
<para>
Якщо &php.ini; знаходиться в місці, де він читається, та PHP запущено як
модуль, то переконайтесь, що ви перезапустили веб-сервер після внесення
модуль, то переконайтесь, що ви перезапустили вебсервер після внесення
змін до &php.ini;
</para>
<para>
@@ -413,13 +412,11 @@ cgi error:
</question>
<answer>
<para>
На Windows NT+ та Windows Server 2000+:
На Windows:
<itemizedlist>
<listitem><para>
Перейдіть в Панель Керування та клікніть на ярлику
Система (Старт -&gt; Налаштування
-&gt; Панель Керування -&gt; Система, або просто Старт -&gt; Панель
Керування -&gt; Система на Windows XP/2003+)
Перейдіть в Панель керування та кляцніть по ярлику Система (Старт →
Панель керування)
</para></listitem>
<listitem><para>
Перейдіть на закладку Додатково
@@ -446,38 +443,12 @@ cgi error:
</para></listitem>
</itemizedlist>
</para>
<para>
У Windows 98/Me вам потрібно змінити файл <filename>autoexec.bat</filename>:
<itemizedlist>
<listitem><para>
Відкрийте Блокнот (Старт -&gt; Виконати та введіть notepad)
</para></listitem>
<listitem><para>
Відкрийте файл <filename>C:\autoexec.bat</filename>
</para></listitem>
<listitem><para>
Знайдіть рядок із PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;..... та допишіть:
<literal>;C:\php</literal> в кінець рядка
</para></listitem>
<listitem><para>
Збережіть файл та перезапустіть ком'ютер
</para></listitem>
</itemizedlist>
</para>
<note>
<simpara>
Не забудьте перезавантажитись після того, як пройдете зазначені вище
кроки, щоб зміни для <envar>PATH</envar> були задіяні.
</simpara>
</note>
<para>
В даному PHP посібнику ще залишились рекомендації копіювання файлів в
системну директорію Windows. Такі рекомендації писались тільки через те,
що ця директорія (<filename>C:\Windows</filename>,
<filename>C:\WINNT</filename>, і т.д.) початково є в системній
змінній <envar>PATH</envar>. На даний момент, рекомендація копіювання файлів в
системну директорію Windows давно вже є застарілою та може спричиняти проблеми.
</para>
</answer>
</qandaentry>
@@ -489,60 +460,9 @@ cgi error:
</question>
<answer>
<para>
Є кілька варіантів це зробити. Якщо ви використовуєте Apache, прочитайте
призначені для нього інструкції встановлення (<link
linkend="install.windows.apache1">Apache 1</link>, <link
linkend="install.windows.apache2">Apache 2</link>), в іншому випадку - ви
Є кілька варіантів це зробити. Якщо ви використовуєте Apache,
зверніться до документації Apache, в іншому випадку — ви
повинні встановити змінну оточення <varname>PHPRC</varname>:
</para>
<para>
На Windows NT, 2000, XP та 2003:
<itemizedlist>
<listitem><para>
Перейдіть в Панель Керування та клікніть ярлик Система (Старт -&gt;
Налаштування -&gt; Панель Керування -&gt; Система, або просто Старт -&gt;
Панель Керування -&gt; Система на Windows XP/2003)
</para></listitem>
<listitem><para>
Перейдіть на закладку Додатково
</para></listitem>
<listitem><para>
Клікніть кнопку 'Змінні Оточення'
</para></listitem>
<listitem><para>
Знайдіть область 'Системні змінні'
</para></listitem>
<listitem><para>
Клікніть 'Нова' та введіть 'PHPRC' як назву змінної, а
шлях до директорії, де розміщено &php.ini; як значення цієї змінної
(наприклад <literal>C:\php</literal>)
</para></listitem>
<listitem><para>
Натискайте OK та перезавантажуйте ком'ютер
</para></listitem>
</itemizedlist>
</para>
<para>
На Windows 98/Me вам потрібно змінити файл <filename>autoexec.bat</filename>:
<itemizedlist>
<listitem><para>
Відкрийте Notepad (Старт -&gt; Виконати та введіть notepad)
</para></listitem>
<listitem><para>
Відкрийте файл <filename>C:\autoexec.bat</filename>
</para></listitem>
<listitem><para>
Додайте новий рядок в кінець файла та допишіть в нього: <literal>set
PHPRC=C:\php</literal> (тільки замініть <literal>C:\php</literal> на
шлях до директорії, де розміщено &php.ini;). Пам'ятайте, що шлях
до директорії не може містити пробіли. Наприклад, якщо ви встановили PHP
в <filename>C:\Program Files\PHP</filename>, вам потрібно вписувати
замість нього шлях <filename>C:\PROGRA~1\PHP</filename>.
</para></listitem>
<listitem><para>
Збережіть файл та перезавантажте комп'ютер
</para></listitem>
</itemizedlist>
</para>
</answer>
</qandaentry>

View File

@@ -1,63 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: ff6d5c7b5dca67d9d4b31411170826f886bc1d2d Maintainer: mproshchuk Status: wip -->
<!-- EN-Revision: ff6d5c7b5dca67d9d4b31411170826f886bc1d2d Maintainer: mproshchuk Status: ready -->
<chapter xml:id="faq.mailinglist" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Mailing lists</title>
<titleabbrev>Mailing lists</titleabbrev>
<title>Списки розсилки</title>
<titleabbrev>Списки розсилки</titleabbrev>
<para>
This section holds questions about how to get in touch with
the PHP community. The best way is the mailing lists.
Цей розділ містить питання про те, як мати зв'язок з PHP-спільнотою.
Найкращий спосіб — список розсилки.
</para>
<qandaset>
<qandaentry xml:id="faq.mailinglist.isthere">
<question>
<para>Are there any PHP mailing lists?</para>
<para>Чи є якісь списки розсилки PHP?</para>
</question>
<answer>
<para>
Of course! There are many mailing lists for several subjects.
The most common community mailing lists can be found on our
<link xlink:href="&url.php.mailing-lists;">mailing list</link> page.
Авжеж! Існують багато списків розсилки для кількох тем. Найпотрібніші
списки розсилки спільноти можна знайти на нашій сторінці
<link xlink:href="&url.php.mailing-lists;">списків розсилки</link>.
</para>
<para>
The most general mailing list is <literal>php-general</literal>.
To subscribe, send a blank email message to
Список розсилки для загальних питань — <literal>php-general</literal>. Щоб
підписатися на нього, надішліть порожнього листа на
<link xlink:href="mailto:&url.ml.general.subscribe;">&url.ml.general.subscribe;</link>.
To unsubscribe, send a blank email to <link xlink:href="mailto:&url.ml.general.unsubscribe;">&url.ml.general.unsubscribe;</link>.
Щоб відписатися, надішліть порожнього листа на
<link xlink:href="mailto:&url.ml.general.unsubscribe;">&url.ml.general.unsubscribe;</link>.
</para>
<para>
You can also subscribe and unsubscribe using the web
interface on our <link xlink:href="&url.php.mailing-lists;">mailing list</link>
page, and unsubscribe instructions are included in the footer of
every mailing list message.
Ви також можете підписатися або відписатися, використовуючи наш
<link xlink:href="&url.php.mailing-lists;">вебінтерфейс
списків розсилки</link>. Інструкції щодо скасування підписки містяться у
нижньому колонтитулі кожного повідомлення списку розсилки.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.mailinglist.others">
<question>
<para>Are there any other communities?</para>
<para>Чи є інші спільноти?</para>
</question>
<answer>
<para>
There are countless PHP-centric communities around the world, and we have
links to some of these resources (and information on how to learn more)
on our <link xlink:href="&url.php.support;">Support</link> page.
По всьому світу є незліченні PHP-спільноти і ми маємо посилання на деякі з
них (та інформацію про те, як дізнатися більше) на нашій сторінці
<link xlink:href="&url.php.support;">Підтримки</link>.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.mailinglist.myown">
<question>
<para>Can I start my own PHP mailing list?</para>
<para>Чи можу я створити власний список розсилки PHP?</para>
</question>
<answer>
<para>
Absolutely! In fact, we not only freely allow it, we encourage it!
Helping others by sharing your knowledge and experience with PHP
helps to foster the growth and development of the global PHP
community and the language itself.
Абсолютно! Ба більше, ми не лише дозволяємо, але й заохочуємо! Варто ділитися з
іншими своїми знаннями і досвідом у PHP задля зростання та розвитку
глобальної PHP-спільноти та мови, як такої.
</para>
</answer>
</qandaentry>
@@ -65,132 +65,129 @@
<qandaentry xml:id="faq.mailinglist.subscribing">
<question>
<para>
Help! I can't seem to subscribe to/unsubscribe from
one of the mailing lists!
ДОпоможіть! Здається, я не можу підписатися/відписатися на потрібний
список розсилки!
</para>
</question>
<answer>
<para>
If you have problems subscribing to or unsubscribing from a mailing
list, it may be because the mailing list software can't figure out
the correct mailing address to use. If your email address is
<literal>joeblow@example.com</literal>, and you are trying to
subscribe to php-general, you can send your subscription request to
<literal>php-general-subscribe-joeblow=example.com@lists.php.net</literal>,
or your unsubscription request to
Якщо ви маєте труднощі з підпискою чи відпискою, можливо, це через
програмне забезпечення списків розсилки, яке не може використати
потрібний емейл. Якщо ваша адреса — <literal>joeblow@example.com</literal>
і ви бажаєте підписатися на php-general, надішліть ваш запит на підписку
на
<literal>php-general-subscribe-joeblow=example.com@lists.php.net</literal>
або ваш запит на відписку на
<literal>php-general-unsubscribe-joeblow=example.com@lists.php.net</literal>.
Use similar addresses for the other mailing lists.
Використовуйте схожі адреси для інших списків розсилки.
</para>
<para>
The most common reason folks have a hard time unsubscribing from our
mailing lists is due to the use of mail forwarders. For example,
if your email address is danbrown@example.com, but you subscribed to
the mailing list with the forwarder php-lists@example.com and forward
that to danbrown@example.com, attempting to unsubscribe
danbrown@example.com will not work, as that address is not even known
to our systems. Instead, you will need to unsubscribe the address to
which the mail is being sent - in this example, php-lists@example.com.
Найпоширеніша причина, чому людям важко скасувати підписку на наші списки
розсилки, пов’язана з використанням засобів пересилання пошти. До прикладу,
якщо ваша email-адреса — danbrown@example.com, але ви підписалися на
список розсилки шляхом пересилання пошти через, наприклад, адресу
php-lists@example.com, спроба відписати danbrown@example.com не спрацює,
бо ця адреса навіть не відома нашій системі. Вам необхідно відписати
адресу, з якої був надісланий лист. В даному випадку
php-lists@example.com.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.mailinglist.archive">
<question>
<para>Is there an archive of the mailing lists anywhere?</para>
<para>Чи існує архів списків розсилки?</para>
</question>
<answer>
<para>
Yes, you will find links to some of the archive sites on the
<link xlink:href="&url.php.mailing-lists;">mailing list</link> page.
You will also find dozens of sites that archive and/or syndicate
our mailing list content by using your favorite Internet search
engine and searching for "php mailing list archives".
Так, ви можете знайти посилання на деякі сайти з архівами на сторінці
<link xlink:href="&url.php.mailing-lists;">списків розсилки</link>. Ви
також можете знайти десятки сайтів, що архівують або зберігають вміст
наших списків розсилки, ввівши у вашій улюбленій пошуковій системі "php
mailing list archives".
</para>
<para>
All mailing list articles are also archived as news
messages. You can access the news server at <link
xlink:href="&url.php.news;">&url.php.news;</link>
with a news client. There is also an experimental web
interface for the news server at <link
xlink:href="&url.php.newsweb;">&url.php.newsweb;</link>
Усі статті в списках розсилки архівовані у вигляді новин. Ви можете
читати їх за допомогою новинного клієнта на новинному сервері
<link xlink:href="&url.php.news;">&url.php.news;</link>. Також існує
експериментальний веб інтерфейс новинного сервера <link
xlink:href="&url.php.newsweb;">&url.php.newsweb;</link>.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.mailinglist.question">
<question>
<para>What can I ask the mailing list?</para>
<para>Що я можу спитати в спискові розсилки?</para>
</question>
<answer>
<para>
Since PHP is growing more and more popular by the day, the traffic
on the php-general mailing list can be very heavy, ranging from
75 to 200 or more posts per day. Because of this, it is in everyone's
interest that you use the list as a last resort, when you have
exhausted all other avenues.
Оскільки PHP щодня стає популярнішою, трафік у спискові розсилки
php-general може бути дуже високим — від 75 до 200 і більше дописів на
день. Через це у кожного в інтересах використовувати список як крайній
засіб, коли вичерпано всі інші можливості.
</para>
<para>
Before you post to the list please have a look in this FAQ and the
manual to see if you can find the help there. If there is nothing
to be found there try out the mailing list archives (see above).
If you're having problem with installing or configuring PHP, please
read through all included documentation and README's. If you still
can't find any information that helps you out, you're more than
welcome to use the appropriate mailing list.
До того, як ви напишете в список, пошукайте, будь ласка, відповіді в цих
ЧаПах та в цьому посібнику. Якщо не знайдете допомогу тут, спробуйте
пошукати в архівах розсилки (див. вище). Якщо ви маєте проблеми зі
встановленням або налаштуванням PHP, будь ласка, прочитайте всю включену
документацію та файли README. Якщо ви досі не можете знайти інформацію,
яка би допомогла, радо просимо скористатися відповідним списком
розсилки.
</para>
<para>
To ensure that you receive the best responses (and to reduce the
likelihood of frustrating your fellow developers), please be sure to
post your question to the appropriate list. For example, if you are
having difficulties installing PHP, you should send your question to
the <literal>php-install</literal> mailing list. A caveat: some lists
have similar names and completely different uses; a question regarding
PHP scripts on Windows should be directed to the Windows PHP users
list, <emphasis>not</emphasis> to the Windows Internals list.
Для певності, що ви отримаєте найкращу відповідь (і для зменшення
ймовірності розчарування ваших колег-розробників), будь ласка,
переконайтеся, що надсилаєте питання до відповідного списку. Наприклад,
якщо ви маєте труднощі з встановленням PHP, надсилайте питання до
списку розсилки <literal>php-install</literal>. Застереження: деякі списки
мають схожі назви і повністю інше використання; питання щодо скриптів PHP
у Windows повинне адресуватися в список розсилки "користувачів Windows з
PHP", а <emphasis>не</emphasis> "внутрішніх елементів Windows".
</para>
<para>
Before asking questions, you may want to read the paper on
<link xlink:href="&url.smart.questions;">How To Ask Questions The Smart
Way</link> as this is a good idea for everyone.
Перш ніж ставити запитання, ви можете прочитати статтю
<link xlink:href="&url.smart.questions;">Як ставити питання вміло</link>,
це хороша ідея для будь кого.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.mailinglist.guideline">
<question>
<para>What information should I include when posting to the mailing list?</para>
<para>Яку інформацію мені варто надати у листі до списку розсилки?</para>
</question>
<answer>
<para>
Posts like "I can't get PHP up and running! Help me! What is
wrong?" are of absolutely no use to anyone. If you're having problems
getting PHP up and running you must include the operating system being
used, the version of PHP you're trying to use, how you got it
(pre-compiled, Git, RPM, and so on), what you have done so far,
and the exact error message or present result.
Допис типу "Я не можу запустити PHP! Допоможіть мені! Що не так?" є геть
некорисним для будь-кого. Якщо ви маєте проблеми з запуском PHP, ви маєте
повідомити, яку операційну систему ви використали, версію PHP, що ви
намагалися запустити, як ви отримали її (скомпільваною, через Git, RPM, і
т.д.), що ви зробили досі, точне повідомлення про помилку або поточний
результат.
</para>
<para>
This goes for any other problem as well: you must include an explanation
of what you have done, what you're trying to do, and any error messages
encountered in the process. If you're having problems with your source
code, you should include the part of the code that isn't working,
indicating which line is the problem by an appropriately-placed code
comment. Do not include more code than necessary though! It makes the
post difficult to read, causing many to ignore your request. If you're
unsure about how much information should be included, post what you
believe is immediately relevant to your present issue, and be prepared
to provide more information upon request.
Це підходить для інших проблем також: ви мусите написати пояснення того,
що ви робили, що ви намагаєтесь зробити, і будь-які повідомлення про
помилки, які виникають у процесі. Якщо маєте проблеми з вашим початковим
кодом, вам варто включити частину коду, яка не працює, помітивши
проблемний рядок коментарем, розміщеним відповідним чином. Однак не
включайте більше коду, ніж потрібно! Це робить повідомлення складним для
читання, змушуючи багатьох ігнорувати ваш запит. Якщо ви не впевнені у
потрібній кількості наданої інформації, опублікуйте те, що, на вашу думку,
безпосередньо стосується вашої поточної проблеми і будьте готові надати
більше інформації на прохання.
</para>
<para>
Another important thing to remember is to summarize your problem
on the subject line. A subject like "HELP MEEEE!!!" or "What is the
problem here?" will be ignored by the majority of the readers.
Інша річ, яку важливо запам'ятати — це узагальнити вашу проблему у темі
листа. Теми на кшталт "РЯТУЙТЕ!!!" або "Що тут за проблема?" будуть
проігноровані більшістю читачів.
</para>
<para>
And lastly, you're encouraged to read the paper on
<link xlink:href="&url.smart.questions;">How To Ask Questions The
Smart Way</link> as this will be a great help for everyone,
especially yourself.
І на кінець, ще раз рекомендуємо прочитати статтю
<link xlink:href="&url.smart.questions;">Як ставити питання вміло</link>,
оскільки допоможе будь-кому, особливо вам.
</para>
</answer>
</qandaentry>

View File

@@ -1,77 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 3e08a8aae657492bdcdc7c550099ddf072042fa9 Maintainer: mproshchuk Status: wip -->
<!-- EN-Revision: 3e08a8aae657492bdcdc7c550099ddf072042fa9 Maintainer: mproshchuk Status: ready -->
<chapter xml:id="faq.misc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Miscellaneous Questions</title>
<titleabbrev>Miscellaneous Questions</titleabbrev>
<title>Різні питання</title>
<titleabbrev>Різні питання</titleabbrev>
<para>
There can be some questions we can't put into other
categories. Here you can find them.
Можуть бути деякі запитання, які ми не можемо віднести до інших категорій.
Ви можете знайти їх тут.
</para>
<qandaset>
<qandaentry xml:id="faq.misc.bz2">
<question>
<para>
How can I handle the bz2 compressed manuals on Windows?
Як я можу працювати зі стиснутими bz2-посібниками у Windows?
</para>
</question>
<answer>
<para>
If you don't have an archiver-tool to handle bz2 files
<link xlink:href="&url.bzip2;">download</link> the command line tool
from Redhat (please find further information below).
Якщо ви не маєте архіватора для роботи з bz2-файлами,
<link xlink:href="&url.bzip2;">завантажте</link> засіб командного рядка від
Redhat (будь ласка, знайдіть додаткову інформацію нижче).
</para>
<para>
If you would not like to use a command line tool, you can try free
tools like <link xlink:href="&url.stuffit;">Stuffit Expander</link>,
Якщо вам не до вподоби засіб командного рядка, ви можете спробувати
безкоштовні інструменти <link xlink:href="&url.stuffit;">Stuffit Expander</link>,
<link xlink:href="&url.ultimatezip;">UltimateZip</link>,
<link xlink:href="&url.7zip;">7-Zip</link>, or
<link xlink:href="&url.quickzip;">Quick Zip</link>. If you
have tools like <link xlink:href="&url.winrar;">WinRAR</link> or
<link xlink:href="&url.powerarchiver;">Power Archiver</link>, you can
easily decompress the bz2 files with it. If you use Total Commander
(formerly Windows Commander),
a bz2 plugin for that program is available freely from the
<link xlink:href="&url.wincmd;">Total Commander</link> site.
<link xlink:href="&url.7zip;">7-Zip</link> або
<link xlink:href="&url.quickzip;">Quick Zip</link>. Такими інструменти як
<link xlink:href="&url.winrar;">WinRAR</link> або
<link xlink:href="&url.powerarchiver;">Power Archiver</link> ви можете
легко розпакувати файли bz2. Якщо ви використовуєте Total Commander
(раніше Windows Commander), bz2-плагін для цієї програми доступний
безкоштовно на сайті
<link xlink:href="&url.wincmd;">Total Commander</link>.
</para>
<para>
The bzip2 command line tool from Redhat:
Засіб командного рядка bzip2 від Redhat:
</para>
<para>
Win2k Sp2 users grab the latest version 1.0.2, all
other Windows user should grab version 1.00. After downloading rename
the executable to bzip2.exe. For convenience put it into a directory in
your path, e.g. C:\Windows where C represents your Windows installation
drive.
Користувачі Win2k Sp2 мають завантажити останню версію 1.0.2, всі інші
користувачі Windows — версію 1.00. Після завантаження перейменуйте
виконуваний файл на bzip2.exe. Для зручності помістіть його в теку на
вашому шляху, наприклад C:\Windows, де "C" представляє ваш інсталяційний
диск Windows.
</para>
<para>
Note: lang stands for your language and x for the desired format, e.g.: pdf.
To uncompress the php_manual_lang.x.bz2 follow these simple instructions:
Примітка: "lang" означає вашу мову, а "x" — потрібний формат, напр.: pdf.
Щоб розпакувати php_manual_lang.x.bz2, виконайте ці прості вказівки:
<itemizedlist>
<listitem>
<simpara>open a command prompt window</simpara>
<simpara>відкрити вікно командного рядка</simpara>
</listitem>
<listitem>
<simpara>
cd to the folder where you stored the
downloaded php_manual_lang.x.bz2
використати команду "cd" для переміщення до теки з завантаженим файлом
php_manual_lang.x.bz2
</simpara>
</listitem>
<listitem>
<simpara>
invoke bzip2 -d php_manual_lang.x.bz2, extracting
php_manual_lang.x in the same folder
запустити bzip2 -d php_manual_lang.x.bz2, видобувши php_manual_lang.x в
ту ж теку
</simpara>
</listitem>
</itemizedlist>
</para>
<para>
In case you downloaded the php_manual_lang.tar.bz2 with many html-files
in it, the procedure is the same. The only difference is that you got a file
php_manual_lang.tar. The tar format is known to be treated with most
common archivers on Windows like e.g.
<link xlink:href="&url.winzip;">WinZip</link>.
Якщо ви завантажили php_manual_lang.tar.bz2 з багатьма HTML-файлами
всередині, процедура та сама. Єдина різниця у назві — php_manual_lang.tar.
Відомо, що формат tar обробляється більшістю поширених архіваторів у
Windows, як-от <link xlink:href="&url.winzip;">WinZip</link>.
</para>
</answer>
</qandaentry>

View File

@@ -1,26 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 17fc359d7eb75d7d6199db77518924f2d351ed8b Maintainer: mproshchuk Status: wip -->
<!-- EN-Revision: 17fc359d7eb75d7d6199db77518924f2d351ed8b Maintainer: mproshchuk Status: ready -->
<chapter xml:id="faq.obtaining" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Obtaining PHP</title>
<titleabbrev>Obtaining PHP</titleabbrev>
<title>Отримання PHP</title>
<titleabbrev>Отримання PHP</titleabbrev>
<para>
This section has details about PHP download locations, and
OS issues.
Цей розділ містить відомості про те, звідки можна завантажити PHP та про
проблеми з операційними системами.
</para>
<qandaset>
<qandaentry xml:id="faq.obtaining.where">
<question>
<para>Where can I obtain PHP?</para>
<para>Звідки я можу отримати PHP?</para>
</question>
<answer>
<para>
You can download PHP from any of the members of the
PHP network of sites. These can be found at
<link xlink:href="&url.php;">&url.php;</link>.
You can also use anonymous Git to get the absolute latest
version of the source. For more information, go to
Ви можете завантажити PHP з будь-якого сайту мережі сайтів PHP. Їх можна
знайти за адресою <link xlink:href="&url.php;">&url.php;</link>. Також ви
можете використати анонімний Git, щоб отримати найновішу версію джерела.
Докладніше:
<link xlink:href="&url.php.anongit;">&url.php.anongit;</link>.
</para>
</answer>
@@ -28,17 +27,17 @@
<qandaentry xml:id="faq.obtaining.precompiled">
<question>
<para>Are pre-compiled binary versions available?</para>
<para>Чи доступні попередньо скомпільовані двійкові версії?</para>
</question>
<answer>
<para>
We only distribute precompiled binaries for Windows systems,
as we are not able to compile PHP for every major Linux/Unix
platform with every extension combination. Also note, that
many Linux distributions come with PHP built in these days.
Windows binaries can be downloaded from our <link
xlink:href="&url.php.downloads;">Downloads</link> page, for Linux
binaries, please visit your distribution's website.
Ми розповсюджуємо попередньо скомпільовані двійкові файли тільки для
систем Windows, бо ми не в змозі компілювати PHP для кожної великої
платформи Linux/Unix з усіма комбінаціями розширень. Зауважте, що зараз
багато дистрибутивів Linux постачаються з вбудованим PHP. Виконувані файли
для Windows можна завантажити на сторінці
<link xlink:href="&url.php.downloads;">Завантаження</link>, а виконувані
файли для Linux на сайті вашого дистрибутива.
</para>
</answer>
</qandaentry>
@@ -46,15 +45,16 @@
<qandaentry xml:id="faq.obtaining.optional">
<question>
<para>
Where can I get libraries needed to compile some of
the optional PHP extensions?
Де я можу отримати бібліотеки, необхідні для компіляції деяких вибіркових
розширень PHP?
</para>
</question>
<answer>
<para>
<note>
<simpara>
Those marked with a * are to the best of our knowledge not thread safe; they are not recommended for use in a multi-threaded environment.
Ті, що позначені "*" наскільки нам відомо, не є потоково безпечними;
не рекомендовано використовувати їх у багатопотоковому середовищі.
</simpara>
</note>
</para>
@@ -110,7 +110,7 @@
<listitem>
<simpara>
<link xlink:href="&url.sybase;">Sybase-CT* (Linux, libc5)</link> :
Available locally.
Доступне локально.
</simpara>
</listitem>
<listitem>
@@ -170,60 +170,61 @@
<qandaentry xml:id="faq.obtaining.how">
<question>
<para>How do I get these libraries to work?</para>
<para>Як змусити ці бібліотеки працювати?</para>
</question>
<answer>
<para>
You will need to follow instructions provided with the library. Some of
these libraries are detected automatically when you run the 'configure'
script of PHP (such as the GD library), and others you will have to
enable using '<literal>--with-EXTENSION</literal>' options to
'<literal>configure</literal>'. Run
'<literal>configure --help</literal>' for a listing of these.
Вам потрібно дотримуватися інструкцій, наданими з бібліотекою. Деякі з цих
бібліотек розпізнаються автоматично, коли ви запускаєте скрипт 'configure'
для PHP (наприклад бібліотека GD), а інші ви маєте увімкнути, використавши
опції '<literal>--with-EXTENSION</literal>' для
'<literal>configure</literal>'. Запустіть
'<literal>configure --help</literal>', щоб вивести їхній перелік.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.obtaining.compilent">
<question>
<para>
I got the latest version of the PHP source code from the Git
repository on my Windows machine, what do I need to compile it?
Я отримав найновішу версію початкового коду PHP зі сховища Git на мою
машину Windows, як мені його компілювати?
</para>
</question>
<answer>
<para>
See the PHP Wiki for the latest instructions: <link xlink:href="https://wiki.php.net/internals/windows/stepbystepbuild">Step by Step Build Instructions</link>
Перегляньте чинні інструкції для PHP тут:
<link xlink:href="https://wiki.php.net/internals/windows/stepbystepbuild">Покрокова інструкція зі збірки</link>
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.obtaining.browscap">
<question>
<para>Where do I find the Browser Capabilities File?</para>
<para>Де я можу знайти файл сумісності браузерів?</para>
</question>
<answer>
<para>
You can find a <filename>browscap.ini</filename> file at
Ви можете знайти файл <filename>browscap.ini</filename> на
<link xlink:href="&url.browscap.download;">&url.browscap.download;</link>.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.obtaining.threadsafety">
<question>
<para>What does thread safety mean when downloading PHP?</para>
<para>Що означає "безпека потоку" під час завантаження PHP?</para>
</question>
<answer>
<para>
Thread Safety means that binary can work in a multithreaded webserver
context, such as Apache 2 on Windows. Thread Safety works by creating
a local storage copy in each thread, so that the data won't collide
with another thread.
Безпека потоку — можливість виконання коду в контексті мультипотокового
вебсервера, як-от Apache 2 у Windows. Безпека потоку досягається шляхом
створення копії локального сховища в кожному потоці задля відсутності
конфлікту даних.
</para>
<para>
So what do I choose? If you choose to run PHP as a CGI binary, then
you won't need thread safety, because the binary is invoked at each
request. For multithreaded webservers, such as IIS5 and IIS6, you should
use the threaded version of PHP.
То що ж вам обрати? Якщо запускатимете PHP, як виконуваний CGI, то безпека
потоку непотрібна, бо виконуваний файл викликатиметься заново під час
кожного запиту. Для мультипотокових вебсерверів, наприклад IIS5 і IIS6,
вам потрібна версія PHP з безпекою потоку.
</para>
</answer>
</qandaentry>

View File

@@ -1,170 +1,160 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: b8e1b1357def73f310c9f7405035b3acc0cb1eaf Maintainer: mproshchuk Status: wip -->
<!-- EN-Revision: b8e1b1357def73f310c9f7405035b3acc0cb1eaf Maintainer: mproshchuk Status: ready -->
<chapter xml:id="faq.passwords" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Safe Password Hashing</title>
<titleabbrev>Password Hashing</titleabbrev>
<title>Безпечне гешування паролів</title>
<titleabbrev>Гешування паролів</titleabbrev>
<para>
This section explains the reasons behind using hashing functions
to secure passwords, as well as how to do so effectively.
Цей розділ пояснює причини використання геш-функцій для убезпечення паролів,
а також, як це зробити ефективно.
</para>
<qandaset>
<qandaentry xml:id="faq.passwords.hashing">
<question>
<para>
Why should I hash passwords supplied by users of my application?
Навіщо мені гешувати користувацькі паролі моєї програми?
</para>
</question>
<answer>
<para>
Password hashing is one of the most basic security considerations that
must be made when designing any application that accepts passwords
from users. Without hashing, any passwords that are stored in your
application's database can be stolen if the database is compromised, and
then immediately used to compromise not only your application, but also
the accounts of your users on other services, if they do not use
unique passwords.
Гешування паролів є основним захисним заходом, що вживається під час
розробки програми, яка буде приймати паролі від користувачів. Без
гешування будь-які паролі, що містяться у вашій базі даних, можуть бути
вкрадені, якщо базу даних зламають, та негайно використані для зламу всієї
вашої програми, а також облікових записів ваших користувачів у інших
сервісах, якщо користувачі задали не унікальні паролі.
</para>
<para>
By applying a hashing algorithm to your user's passwords before storing
them in your database, you make it implausible for any attacker to
determine the original password, while still being able to compare
the resulting hash to the original password in the future.
Застосовуючи алгоритм гешування користувацьких паролів перед зберіганням
їх у вашій базі даних, ви унеможливлюєте викриття зловмисником
оригінального пароля, маючи при тому змогу у майбутньому порівнювати
отриманий геш з наявним.
</para>
<para>
It is important to note, however, that hashing passwords only protects
them from being compromised in your data store, but does not necessarily
protect them from being intercepted by malicious code injected into your
application itself.
Важливо підкреслити, що гешування паролів лише захищає їх від того, щоб
бути скомпрометованими у вашому сховищі даних, але аж ніяк не захищає їх
від перехоплення зловмисним кодом, впровадженим у вашу програму.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.passwords.fasthash">
<question>
<para>
Why are common hashing functions such as <function>md5</function> and
<function>sha1</function> unsuitable for passwords?
Чому такі поширені геш-функції як <function>md5</function> і
<function>sha1</function> не придатні для паролів?
</para>
</question>
<answer>
<para>
Hashing algorithms such as MD5, SHA1 and SHA256 are designed to be
very fast and efficient. With modern techniques and computer equipment,
it has become trivial to "brute force" the output of these algorithms,
in order to determine the original input.
Алгоритми гешування MD5, SHA1 та SHA256 розроблені бути дуже швидкими та
ефективними. З сучасною технікою та комп'ютерним обладнанням стало
легко зламати результат цих алгоритмів, щоб визначити початковий текст.
</para>
<para>
Because of how quickly a modern computer can "reverse" these hashing
algorithms, many security professionals strongly suggest against
their use for password hashing.
Через те, як швидко сучасні комп'ютери можуть запустити такий алгоритм в
зворотньому напрямку, багато фахівців з безпеки наполягають не
використовувати таке гешування.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.passwords.bestpractice">
<question>
<para>
How should I hash my passwords, if the common hash functions are
not suitable?
Як мені гешувати паролі, якщо поширені геш-функції не придатні.
</para>
</question>
<answer>
<para>
When hashing passwords, the two most important considerations are the
computational expense, and the salt. The more computationally expensive
the hashing algorithm, the longer it will take to brute force its
output.
Під час гешування паролів двома найважливішими факторами є витрати на
обчислення та т. зв. "сіль". Чим більше обчислень має виконати алгоритм,
тим довше триватиме злам результату його обчислень.
</para>
<para>
PHP provides
<link linkend="book.password">a native password hashing API</link> that
safely handles both <link linkend="function.password-hash">hashing</link>
and <link linkend="function.password-verify">verifying passwords</link>
in a secure manner.
PHP має
<link linkend="book.password">вбудований API гешування паролів</link>,
який надає засоби як
<link linkend="function.password-hash">гешування</link>, так і
<link linkend="function.password-verify">перевірки паролів</link>
безпечним способом.
</para>
<!-- TODO Drop mention of crypt? -->
<para>
Another option is the <function>crypt</function> function, which
supports several hashing algorithms. When using
this function, you are guaranteed that the algorithm you select is
available, as PHP contains native implementations of each supported
algorithm, in case one or more are not supported by your system.
Інший спосіб — це функція <function>crypt</function>, яка підтримує
декілька алгоритмів гешування. Використовуючи цю функцію, ви гарантовано
оберете доступний алгоритм, адже PHP має власну реалізацію кожного
підтримуваного алгоритму, навіть якщо один або декілька не підтримуються
вашою системою.
</para>
<para>
The suggested algorithm to use when hashing passwords is Blowfish, which
is also the default used by the password hashing API, as it is
significantly more computationally expensive than MD5 or SHA1, while
still being scalable.
Для гешування паролів рекомендується алгоритм Blowfish, який стандартно
використовується API гешування паролів, оскільки він є набагато дорожчим
в обчисленні, аніж MD5 або SHA1, залишаючись масштабованим.
</para>
<para>
Note that if you are using <function>crypt</function> to verify a
password, you will need to take care to prevent timing attacks by using
a constant time string comparison. Neither PHP's
<link linkend="language.operators.comparison">== and === operators</link>
nor <function>strcmp</function> perform constant time string
comparisons. As <function>password_verify</function> will do this for
you, you are strongly encouraged to use the
<link linkend="book.password">native password hashing API</link>
whenever possible.
Зауважте, якщо ви використовуєте <function>crypt</function> для перевірки
пароля, вам необхідно подбати про запобігання часових атак, використовуючи
однаковий час для порівняння рядків. Ані
<link linkend="language.operators.comparison">оператори == і ===</link>,
ані <function>strcmp</function> не виконують порівняння за однаковий
проміжок часу. Тільки <function>password_verify</function> зробить це для
вас, тож дуже просимо використовувати
<link linkend="book.password">вбудований API гешування паролів</link> за
будь-якої можливості.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.passwords.salt">
<question>
<para>
What is a salt?
Що таке "сіль"?
</para>
</question>
<answer>
<para>
A cryptographic salt is data which is applied during the hashing process
in order to eliminate the possibility of the output being looked up
in a list of pre-calculated pairs of hashes and their input, known as
a rainbow table.
Криптографічна сіль — це текст, який дописується до даних у процесі
гешування, щоб унеможливити пошук результатів у списку попередньо
обчислених пар гешів та їхніх вхідних даних, відомого як райдужна таблиця.
</para>
<para>
In more simple terms, a salt is a bit of additional data which makes
your hashes significantly more difficult to crack. There are a number of
services online which provide extensive lists of pre-computed hashes, as
well as the original input for those hashes. The use of a salt makes it
implausible or impossible to find the resulting hash in one of these
lists.
Простими словами, сіль — це допоміжна частинка даних, яка значно ускладнює
злам ваших гешів . Існує певна кількість онлайн сервісів з надання
розширених списків попередньо обчислених гешів, а також їхніх вхідних
даних. Використання солі робить малоймовірним або неможливим знаходження
отриманого гешу в одному з цих списків.
</para>
<para>
<function>password_hash</function> will create a random salt if one
isn't provided, and this is generally the easiest and most secure
approach.
<function>password_hash</function> створить випадкову сіль, коли та не
вказана, і це, як правило, найпростіший і найбезпечніший підхід.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.password.storing-salts">
<question>
<para>
How do I store my salts?
Як мені зберігати цю сіль?
</para>
</question>
<answer>
<para>
When using <function>password_hash</function> or
<function>crypt</function>, the return value includes the salt as part
of the generated hash. This value should be stored verbatim in your
database, as it includes information about the hash function that was
used and can then be given directly to
<function>password_verify</function> or <function>crypt</function> when
verifying passwords.
У <function>password_hash</function> або <function>crypt</function>
значення, що повертається, містить сіль як частину утвореного гешу. Це
значення має бути точно збережене у вашій базі даних, оскільки воно
містить інформацію про геш-функцію, яка використовувалася, і потім може
бути надано безпосередньо до <function>password_verify</function> або
<function>crypt</function> під час перевірки паролів.
</para>
<para>
The following diagram shows the format of a return value from
<function>crypt</function> or <function>password_hash</function>. As you
can see, they are self-contained, with all the information on the
algorithm and salt required for future password verification.
На наступній діаграмі показано формат значення, що повертається функціями
<function>crypt</function> або <function>password_hash</function>. Як
можна побачити, значення є самодостатнім, з усією інформацією про
алгоритм і сіль, необхідну для майбутньої перевірки пароля.
</para>
<para>
<mediaobject>
<alt>
The components of the value returned by password_hash and crypt: in
order, the chosen algorithm, the algorithm's options, the salt used,
and the hashed password.
Порядок складових значення, що повертають функції password_hash і crypt:
обраний алгоритм, опції алгоритму, використана сіль, загешований пароль.
</alt>
<imageobject>
<imagedata fileref="en/faq/figures/crypt-text-rendered.svg" width="690" depth="192" format="SVG" />

View File

@@ -1,33 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 68d6316b3cb2094e96c0d929e2ad259b204f24c4 Maintainer: ktretyak Status: wip -->
<!-- $Revision$ -->
<!-- EN-Revision: 0a3a57fae02391db80baeba98c9a071dc2760889 Maintainer: mproshchuk Status: ready -->
<chapter xml:id="faq.using" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Using PHP</title>
<titleabbrev>Using PHP</titleabbrev>
<title>Використання PHP</title>
<titleabbrev>Використання PHP</titleabbrev>
<para>
This section gathers many common errors that you may face
while writing PHP scripts.
Цей розділ зібрав багато розповсюджених помилок, з якими можна зіткнутися під
час написання PHP-скриптів.
</para>
<qandaset>
<qandaentry xml:id="faq.using.parameterorder">
<!-- TODO: Mention named arguments -->
<question>
<para>
I cannot remember the parameter order of PHP functions, are they random?
Я не пам’ятаю порядок параметрів функцій PHP, він хаотичний?
</para>
</question>
<answer>
<para>
PHP is a glue that brings together hundreds of external libraries, so sometimes
this gets messy. However, a simple rule of thumb is as follows:
PHP — це "клей", який об’єднує сотні зовнішніх бібліотек, тому іноді
виглядає безладним. Однак просте правило полягає в наступному:
</para>
<para>
<link linkend="book.array">Array function</link> parameters are ordered
as "<emphasis>needle, haystack</emphasis>" whereas
<link linkend="book.strings">String functions</link> are the opposite,
so "<emphasis>haystack, needle</emphasis>".
Параметри <link linkend="book.array">функцій для роботи з масивами</link>
розміщені у порядку "<emphasis>needle, haystack</emphasis>", натомість у
<link linkend="book.strings">функцій для роботи з рядками</link> навпаки —
"<emphasis>haystack, needle</emphasis>".
</para>
</answer>
</qandaentry>
@@ -35,19 +35,19 @@
<qandaentry xml:id="faq.using.anyform">
<question>
<para>
I would like to write a generic PHP script that can handle data coming
from any form. How do I know which POST method variables are available?
Я б хотів написати загальний PHP-скрипт для обробки даних, що надходять з
форм. Як мені дізнатися, які змінні методу POST доступні?
</para>
</question>
<answer>
<para>
PHP offers many <link linkend="language.variables.predefined">
predefined variables</link>, like the superglobal <varname>
$_POST</varname>. You may loop through <varname>$_POST</varname>
as it's an associate array of all POSTed values. For example, let's
simply loop through it with &foreach;,
check for <function>empty</function> values,
and print them out.
PHP пропонує багато <link linkend="language.variables.predefined">
попередньо визначених змінних</link>, наприклад суперглобальну
<varname>$_POST</varname>. Ви можете застосувати цикл до
<varname>$_POST</varname>, оскільки це асоціативний масив усіх значень
POSTу. Нехай просто пройдемося по ньому за допомогою &foreach;,
перевіримо наявність <function>порожніх</function> значень, та виведемо їх
на екран.
<programlisting role="php">
<![CDATA[
<?php
@@ -62,137 +62,47 @@ foreach ($_POST as $varname => $varvalue) {
print "<pre>";
if (empty($empty)) {
print "None of the POSTed values are empty, posted:\n";
print "Жодне значення POSTу не порожнє, ось вони:\n";
var_dump($post);
} else {
print "We have " . count($empty) . " empty values\n";
print "Posted:\n"; var_dump($post);
print "Empty:\n"; var_dump($empty);
print "Дано " . count($empty) . " порожніх значень.\n";
print "Заповнені:\n"; var_dump($post);
print "Порожні:\n"; var_dump($empty);
exit;
}
?>
]]>
</programlisting>
</para>
&note.superglobals;
</answer>
</qandaentry>
<qandaentry xml:id="faq.using.addslashes">
<!-- TODO Probably should mention not doing this... -->
<question>
<para>
I need to convert all single-quotes (') to a backslash
followed by a single-quote (\'). How can I do this with a
regular expression? I'd also like to convert " to \" and
\ to \\.
Мені треба додати перед усіма одинарними лапками (') зворотню косу риску
(\). Як це зробити за допомогою регулярного виразу? Мені б також хотілося
замінити (") на (\") та (\) на (\\).
</para>
</question>
<answer>
<para>
Assuming this is for a database, use the escaping mechanism that
comes with the database. For example, use
<function>mysql_real_escape_string</function> with MySQL and
<function>pg_escape_string</function> with PostgreSQL. There is
also the generic <function>addslashes</function> and
<function>stripslashes</function> functions, that are more
common with older PHP code.
Схоже, це для бази даних, але в ній вже існує механізм екранування
символів, тож використовуйте його. Для MySQL — це
<function>mysql_real_escape_string</function>, а для PostgreSQL
<function>pg_escape_string</function>. Також є загальні функції
<function>addslashes</function> і <function>stripslashes</function>, які
частіше зустрічаються у старому коді PHP.
</para>
&note.magicquotes.gpc;
</answer>
</qandaentry>
<qandaentry xml:id="faq.using.stripslashes">
<question>
<para>
All my " turn into \" and my ' turn into \', how do I get rid of all
these unwanted backslashes? How and why did they get there?
</para>
</question>
<answer>
<para>
Most likely the backslashes magically exist because the PHP directive
<link linkend="ini.magic-quotes-gpc">magic_quotes_gpc</link> is on.
This is an old feature of PHP, and should be disabled and not relied
upon. Also, the PHP function <function>stripslashes</function> may be
used to strip the backslashes from the <type>string</type>.
</para>
&note.magicquotes.gpc;
</answer>
</qandaentry>
<qandaentry xml:id="faq.register-globals">
<question>
<para>
Який вплив має register_globals?
</para>
</question>
<answer>
&warn.deprecated.feature-5-3-0.removed-5-4-0;
<para>
First, an explanation about what this ini setting does. Let's say the
following URL is used:
<literal>http://example.com/foo.php?animal=cat</literal>
and in <filename>foo.php</filename> we might have the following
PHP code:
</para>
<para>
<programlisting role="php">
<![CDATA[
<?php
// Using $_GET here is preferred
echo $_GET['animal'];
// For $animal to exist, register_globals must be on
// DO NOT DO THIS
echo $animal;
// This applies to all variables, so $_SERVER too
echo $_SERVER['PHP_SELF'];
// Again, for $PHP_SELF to exist, register_globals must be on
// DO NOT DO THIS
echo $PHP_SELF;
?>
]]>
</programlisting>
</para>
<para>
The code above demonstrates how register_globals creates a lot of
variables. For years this type of coding has been frowned upon, and for
years it's been disabled by default. So although most web hosts disable
register_globals, there are still outdated articles, tutorials, and books
that require it to be on. Plan accordingly.
</para>
<para>
See also the following resources for additional information:
<simplelist>
<member>The <link linkend="ini.register-globals">register_globals</link> directive</member>
<member>The <link linkend="security.globals">security chapter about register globals</link></member>
<member><link linkend="language.variables.external">Handling external variables</link></member>
<member>Use <link linkend="language.variables.superglobals">superglobals</link> instead</member>
</simplelist>
</para>
<note>
<para>
In the example above, we used an <acronym>URL</acronym> that contained
a QUERY_STRING. Passing information like this is done through a GET HTTP
Request, so this is why the superglobal <varname>$_GET</varname> was used.
</para>
</note>
</answer>
</qandaentry>
<qandaentry xml:id="faq.using.wrong-order">
<question>
<para>
When I do the following, the output is printed in
the wrong order:
Коли я роблю наступне, результат виводиться не за порядком:
<programlisting role="php">
<![CDATA[
<?php
@@ -205,15 +115,15 @@ echo "myfunc($variable) = " . myfunc($variable);
?>
]]>
</programlisting>
what's going on?
що відбувається?
</para>
</question>
<answer>
<para>
To be able to use the results of your function in an expression (such
as concatenating it with other strings in the example above), you need
to <function>return</function> the value,
not <function>echo</function> it.
Щоб могти використовувати результат вашої функції у виразі (наприклад
приєднати його до іншого рядка, як показано вище), вам необхідно
<function>повернути</function> значення, а не виводити його на екран
конструкцією <function>echo</function>.
</para>
</answer>
</qandaentry>
@@ -221,12 +131,12 @@ echo "myfunc($variable) = " . myfunc($variable);
<qandaentry xml:id="faq.using.newlines">
<question>
<para>
Hey, what happened to my newlines?
Ей, чому все в одному рядку?
<programlisting role="php">
<![CDATA[
<pre>
<?php echo "This should be the first line."; ?>
<?php echo "This should show up after the new line above."; ?>
<?php echo "Це має бути перший рядок."; ?>
<?php echo "Це має виводитись після символу початку рядка, що є вище."; ?>
</pre>
]]>
</programlisting>
@@ -234,18 +144,17 @@ echo "myfunc($variable) = " . myfunc($variable);
</question>
<answer>
<para>
In PHP, the ending for a block of code is either "?&gt;" or
"?&gt;\n" (where \n means a newline). So in the example above,
the echoed sentences will be on one line, because PHP omits
the newlines after the block ending. This means that you need to
insert an extra newline after each block of PHP code to make
it print out one newline.
У PHP закінченням блоку коду є як "?&gt;", так і "?&gt;\n" (де \n означає
початок нового рядка). Тож у прикладі вище виведені речення будуть на
одній лінії, бо PHP опускає символ початку рядка. З цього випливає, що вам
необхідно вставити ще один символ нового рядка після кожного блоку коду
PHP, щоб виводився один новий рядок.
</para>
<para>
Why does PHP do this? Because when formatting normal HTML, this
usually makes your life easier because you don't want that newline,
but you'd have to create extremely long lines or otherwise make the
raw page source unreadable to achieve that effect.
Чому PHP робить це? Бо під час форматування простого HTML це, зазвичай,
полегшує вам життя, якщо не потрібно виводити цей символ. Бо інакше
доведеться створювати надто довгі рядки, щоб досягнути такого ж ефекту, а
це зробить код не придатним для читання.
</para>
</answer>
</qandaentry>
@@ -253,20 +162,21 @@ echo "myfunc($variable) = " . myfunc($variable);
<qandaentry xml:id="faq.using.headers-sent">
<question>
<para>
I get the message 'Warning: Cannot send session cookie - headers already
sent...' or 'Cannot add header information - headers already sent...'.
Я отримую повідомлення "Warning: Cannot send session cookie - headers
already sent..." або "Cannot add header information - headers already
sent...".
</para>
</question>
<answer>
<para>
The functions <function>header</function>, <function>setcookie</function>,
and the <link linkend="ref.session">session
functions</link> need to add headers to the output stream but headers
can only be sent before all other content. There can be no output
before using these functions, output such as HTML. The function
<function>headers_sent</function> will check if your script has already
sent headers and see also the <link linkend="ref.outcontrol">Output Control
functions</link>.
Функції <function>header</function>, <function>setcookie</function>,
та <link linkend="ref.session">функції для роботи з сесіями</link>
надсилають заголовки до потоку виводу, проте заголовки можна
надіслати тільки перед всім іншим вмістом. Тобто не можна нічого виводити
перед використанням цих функцій, наприклад код HTML. Функція
<function>headers_sent</function> може перевірити, чи ваш скрипт надіслав
заголовки. Докладніше: <link linkend="ref.outcontrol">Функції контролю
виводу</link>.
</para>
</answer>
</qandaentry>
@@ -274,15 +184,15 @@ echo "myfunc($variable) = " . myfunc($variable);
<qandaentry xml:id="faq.using.header">
<question>
<para>
I need to access information in the request header directly.
How can I do this?
Мені потрібен прямий доступ до інформації в заголовку запиту. Як я можу
це зробити?
</para>
</question>
<answer>
<para>
The <function>getallheaders</function> function will do this if
you are running PHP as an Apache module. So, the following bit
of code will show you all the request headers:
Це робить функція <function>getallheaders</function> за умови запуску PHP
як модуля Apache. Тоді наступний коротенький код покаже всі заголовки
запиту:
<programlisting role="php">
<![CDATA[
<?php
@@ -295,9 +205,9 @@ foreach ($headers as $name => $content) {
</programlisting>
</para>
<para>
See also
Перегляньте також
<function>apache_lookup_uri</function>,
<function>apache_response_headers</function>, and
<function>apache_response_headers</function> та
<function>fsockopen</function>
</para>
</answer>
@@ -306,22 +216,20 @@ foreach ($headers as $name => $content) {
<qandaentry xml:id="faq.using.authentication">
<question>
<para>
When I try to use authentication with IIS I get 'No Input file specified'.
Коли я намагаюся використати автентифікацію за допомогою IIS, я отримую
'No Input file specified'.
</para>
</question>
<answer>
<para>
The security model of IIS is at fault here. This is a problem
common to all CGI programs running under IIS. A workaround is
to create a plain HTML file (not parsed by PHP) as the entry page
into an authenticated directory. Then use a META tag to redirect
to the PHP page, or have a link to the PHP page. PHP will
then recognize the authentication correctly. With the ISAPI
module, this is not a problem. This should not affect other
NT web servers. For more information, see:
<link xlink:href="&url.iis;">&url.iis;</link> and the manual
section on <link linkend="features.http-auth">HTTP Authentication
</link>.
У цьому винна модель безпеки IIS. Це є проблемою усіх CGI-застосунків в
IIS. Щоб обійти її, створіть простий файл HTML (що не обробляється PHP),
який буде сторінкою входу в теці автентифікації. Потім використайте
META-тег для перенаправлення на PHP-сторінку, або посилання. PHP розпізна́є
спробу входу коректно. Це не повинно впливати на інші вебсервери NT.
Більше інформації за адресою <link xlink:href="&url.iis;">&url.iis;</link>
та у розділі посібника
<link linkend="features.http-auth">HTTP-автентифікація</link>.
</para>
</answer>
</qandaentry>
@@ -329,22 +237,24 @@ foreach ($headers as $name => $content) {
<qandaentry xml:id="faq.using.iis.sharing">
<question>
<para>
Windows: I can't access files shared on another computer using IIS
Windows: Я не можу отримати доступ до файлів, спільних з іншим
комп'ютером, використовуючи IIS.
</para>
</question>
<answer>
<para>
You have to change the <literal>Go to Internet Information
Services</literal>. Locate your PHP file and go to its properties.
Go to the <literal>File Security</literal> tab, <literal>Edit -&lt;
Потрібно внести зміни. Перейдіть в
<literal>Internet Information Services</literal>. Знайдіть свій файл PHP
і перейдіть до його властивостей. Далі до вкладки
<literal>File Security</literal>, далі — <literal>Edit -&lt;
Anonymous access and authentication control</literal>.
</para>
<para>
You can fix the problem either by unticking <literal>Anonymous
Access</literal> and leaving <literal>Integrated Window
Authentication</literal> ticked, or, by ticking <literal>Anonymous
Access</literal> and editing the user as he may not have the access
right.
Ви можете вирішити проблему, знявши галочку <literal>Anonymous
Access</literal> і залишивши галочку <literal>Integrated Window
Authentication</literal>, або поставити галочку <literal>Anonymous
Access</literal> і відредагувати користувача, оскільки він може не мати
прав доступу.
</para>
</answer>
</qandaentry>
@@ -352,20 +262,20 @@ foreach ($headers as $name => $content) {
<qandaentry xml:id="faq.using.mixml">
<question>
<para>
How am I supposed to mix XML and PHP? It complains
about my &lt;?xml tags!
Як я можу змішувати XML та PHP? Інтерпретатор скаржиться на теги
"&lt;?xml"!
</para>
</question>
<answer>
<para>
In order to embed &lt;?xml straight into your PHP code, you'll have to turn off
short tags by having the PHP directive
<link linkend="ini.short-open-tag">short_open_tags</link> set to
<literal>0</literal>. You cannot set this directive with
<function>ini_set</function>. Regardless of
<link linkend="ini.short-open-tag">short_open_tags</link> being on or
off, you can do something like: <literal>&lt;?php echo '&lt;?xml'; ?&gt;</literal>.
The default for this directive is <literal>On</literal>.
Щоб вставляти &lt;?xml прямо у ваш код PHP, треба вимкнути короткі теги,
задавши директиві PHP
<link linkend="ini.short-open-tag">short_open_tags</link> значення
<literal>0</literal>. Не дозволяється використовувати для цього функцію
<function>ini_set</function>. Якщо вимкнути
<link linkend="ini.short-open-tag">short_open_tags</link>, ви зможете
робити щось на кшталт: <literal>&lt;?php echo '&lt;?xml'; ?&gt;</literal>.
Початкове значення цієї директиви: <literal>On</literal>.
</para>
</answer>
</qandaentry>
@@ -373,132 +283,67 @@ foreach ($headers as $name => $content) {
<qandaentry xml:id="faq.using.variables">
<question>
<para>
Where can I find a complete list of variables are available to me
in PHP?
Де я можу знайти повний список змінних, які мені доступні в PHP?
</para>
</question>
<answer>
<para>
Read the manual page on <link linkend="language.variables.predefined">
predefined variables</link> as it includes a partial list of predefined
variables available to your script. A complete list of available
variables (and much more information) can be seen by calling the
<function>phpinfo</function> function. Be sure to read the manual
section on <link linkend="language.variables.external">variables from
outside of PHP</link> as it describes common scenarios for
external variables, like from a HTML form, a Cookie, and the URL.
Прочитайте сторінку посібника про
<link linkend="language.variables.predefined">попередньо визначені
змінні</link>, вона містить неповний список попередньо визначених змінних,
які доступні вашому скрипту. А повний список (і багато іншої інформації)
виводить функція <function>phpinfo</function>. Обов'язково прочитайте
розділ посібника про <link linkend="language.variables.external">змінні,
що поза PHP</link>, оскільки він описує поширені сценарії зі зовнішніми
змінними, як-от з HTML-форми, Cookie та URL.
</para>
&note.registerglobals;
</answer>
</qandaentry>
<qandaentry xml:id="faq.using.freepdf">
<question>
<para>
How can I generate PDF files without using the non-free and
commercial libraries like
<link linkend="ref.pdf">PDFLib</link>? I'd like something that's
free and doesn't require external PDF libraries.
Як генерувати файли PDF без платних комерційних бібліотек, таких як
PDFLib? Я б хотів щось безкоштовне і що не вимагає зовнішніх бібліотек.
</para>
</question>
<answer>
<para>
There are a few alternatives written in PHP such as
<link xlink:href="&url.pdf.fpdf;">FPDF</link> and
Є альтернативи, написані на PHP:
<link xlink:href="&url.pdf.fpdf;">FPDF</link> та
<link xlink:href="&url.pdf.tcpdf;">TCPDF</link>.
</para>
<para>
There is also the <link linkend="book.haru">Haru</link> extension
that uses the free libHaru external library.
</para>
</answer>
</qandaentry>
<qandaentry xml:id="faq.using.cgi-vars">
<question>
<para>
I'm trying to access one of the standard CGI
variables (such as <varname>$DOCUMENT_ROOT</varname> or
<varname>$HTTP_REFERER</varname>) in a user-defined
function, and it can't seem to find it. What's wrong?
</para>
</question>
<answer>
<para>
It's important to realize that the PHP directive <link
linkend="ini.register-globals">register_globals</link> also affects
server and environment variables. When register_globals = off (the
default is off since PHP 4.2.0), <varname>$DOCUMENT_ROOT</varname>
will not exist. Instead, use <varname>$_SERVER['DOCUMENT_ROOT']
</varname>. If register_globals = on then the variables
<varname>$DOCUMENT_ROOT</varname> and
<varname>$GLOBALS['DOCUMENT_ROOT']</varname> will also exist.
</para>
<para>
If you're sure register_globals = on and wonder why
<varname>$DOCUMENT_ROOT</varname> isn't available inside functions,
it's because these are like any other variables and would
require <literal>global $DOCUMENT_ROOT</literal> inside the
function. See also the manual page on
<link linkend="language.variables.scope">variable scope</link>. It's
preferred to code with register_globals = off.
</para>
&note.superglobals;
</answer>
</qandaentry>
<qandaentry xml:id="faq.using.shorthandbytes">
<question>
<para>
A few PHP directives may also take on shorthand byte values, as opposed
to only <type>integer</type> byte values. What are all the available
shorthand byte options? And can I use these outside of &php.ini;?
Певні директиви PHP можуть мати скорочене байтове значення, крім, коли
воно записується виключно <type>числом</type>. Які скорочення дозволені?
</para>
</question>
<answer>
<para>
The available options are K (for Kilobytes), M (for Megabytes) and G (for
Gigabytes; available since PHP 5.1.0), these are case insensitive.
Anything else assumes bytes.
<literal>1M</literal> equals one Megabyte or <literal>1048576</literal>
bytes. <literal>1K</literal> equals one Kilobyte or
<literal>1024</literal> bytes. You may not use these shorthand
notations outside of &php.ini;, instead use an <type>integer</type>
value of bytes. See the <function>ini_get</function> documentation for
an example on how to convert these values.
K (для кілобайтів), M (для мегабайтів) та G (для гігабайтів) незалежно від
регістру символу. Все інше — це байти. <literal>1M</literal> дорівнює
одному мегабайту або <literal>1048576</literal> байтам.
<literal>1K</literal> дорівнює одному кілобайту або
<literal>1024</literal> байтам. Такі скорочення можна використовувати в
&php.ini; та в функції <function>ini_set</function>.
Майте на увазі, що числове значення приводиться до типу <type>int</type>;
наприклад <literal>0.5M</literal> трактується як <literal>0</literal>.
</para>
<note>
<title>kilobyte versus kibibyte</title>
<title>Кілобайти проти кібібайтів</title>
<para>
The PHP notation describes one kilobyte as equalling 1024 bytes, whereas
the <acronym>IEC</acronym> standard considers this to be a kibibyte instead.
Summary: k and K = 1024 bytes.
Нотація PHP визначає один кілобайт рівним 1024 байтам, в той час як
стандарт <acronym>IEC</acronym> вважає це кібібайтом.
Підсумок: k та K = 1024 байтів.
</para>
</note>
</answer>
</qandaentry>
<qandaentry xml:id="faq.using.windowslocalhostissue">
<question>
<para>
Windows: I keep getting connection timeouts when using <literal>localhost</literal>,
whereas <literal>"127.0.0.1"</literal> works?
</para>
</question>
<answer>
<para>
Prior to PHP 5.3.4, there was a bug in the network resolving code inside PHP that
caused <literal>localhost</literal> in all stream related situations to fail if IPv6
was enabled. To work around this issue you can either use <literal>"127.0.0.1"</literal>
or disable IPv6 resolving in the <filename>hosts</filename> file.
</para>
</answer>
</qandaentry>
</qandaset>
</chapter>

View File

@@ -50,7 +50,8 @@
Azure. Дивіться: <link xlink:href="https://github.com/Azure/azure-sdk-for-php">Azure SDK для PHP</link>.
</para>
<para>Для детальної інформації перегляньте <link xlink:href="https://azure.microsoft.com/en-us/develop/php/">Azure PHP Developer Center</link>
<para>Для докладної інформації перегляньте
<link xlink:href="https://azure.microsoft.com/en-us/develop/php/">Azure PHP Developer Center</link>
</para>
<sect2>

View File

@@ -447,7 +447,7 @@ $ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php
<para>
Не зважаючи на те як запущено PHP, ви можете змінити конкретне значення
директиви під час виконання вашого скрипта через функцію
<function>ini_set</function>. Детальнішу інформацію можна прочитати на
<function>ini_set</function>. Докладнішу інформацію можна прочитати на
сторінці <function>ini_set</function>.
</para>
<para>

View File

@@ -45,7 +45,7 @@
<para>
Microsoft Visual C++ Redistributable для Visual Studio 2019 підходить для
всіх версій PHP. Детальніше за посиланням
всіх версій PHP. Докладніше за посиланням
<link xlink:href="https://visualstudio.microsoft.com/downloads/">https://visualstudio.microsoft.com/downloads/</link>.
</para>