Customize the php ini file. Installation and configuration of PHP. Select one of the options

Next, we will install PHP and configure the web server on your website. We unpack the zip archives (php-5.2.9-Win32.zip) from a folder that is handy for you (most likely in C:\php 5; I follow the fact that the unpacking was done here, since you have PHP in a different place , then, obviously, go ahead and vikorize your catalogue). Go to this folder and rename the php.ini-dist file to php.ini. Open the file with Notepad or any text editor. I respect that standard adjustments are good, requiring only a few directives to be corrected. You will now need to select a location on the disk where server documents, such as HTML, PHP files, etc., will be saved. In the previous article, about installing Apache, we selected the directory C:\www\htdocs. Then we need to correct the directive in the php.ini file

Doc_root =

Doc_root = "C:\www\htdocs"

Also obov'yazkovo vipravity extension_dir s

Extension_dir = "./"

;extension=php_mysql.dll ;extension=php_mysqli.dll

If you plan to review any other modules, then uncomment them as well. Axis list of main modules:

;extension=php_bz2.dll - for working with bz2 archives (unpacking/packaging with scripts) ;extension=php_curl.dll - this is a curl extension; To help you, you can, for example, send a POST request to another script from the script; extension = php_exif.dll - for working with additional information in photo files; extension = php_gd2.dll - graphical library for generating little ones by scripts; - this is a library for working with large-byte (Unicode-encoded) rows, it is necessary to connect it, otherwise CMS actions may not work; extension = php_msql.dll - for robots with mSQL database; extension=php_mysql.dll – standard MySQL library; for MySQL versions 5 and older, use the mysqli module; extension = php_mysqli.dll - improved (MySQL Improved) library for working with MySQL. For working with MySQL5, it is better to use the same ;extension=php_pdo.dll - this module, as well as all PDO modules, will provide a unified interface to rich databases. It’s interesting that there is (as far as I know, more than the standard ones) a single way to work with SQLite 3 databases; extension = php_pgsql.dll - for robots using the PostgreSQL DBMS; sockets and scripts; extension = php_sqlite.dll - for working with a serverless SQLite database. This module supports only version 2 of database files; extension = php_zip.dll - for working with zip archives (the same as for bz2)

You can immediately uncomment a number of modules that are often reviewed.

Extension=php_gd2.dll extension=php_mbstring.dll

This completes editing php.ini (don't forget to save your changes!). Now from the C:\php5 directory to the C:\WINNT\System32 directory, copy the libmysql.dll file. VIN is required to work PHP with MySQL. Or add it through the speck along the road C:\php5 y zminnu path - Power of the system -> Dodatkovo -> Zmіnnі seredovishcha -> Path. In order to change the situation once again, you need to reinstall the computer.

Go to the catalog C:\Program files\Apache2.2\conf and open the httpd.conf file in a text editor.

We recommend adding this to the front row:

LoadModule php5_module "c:/php/php5apache2_2.dll" PHPIniDir "C:/WINNT"

That's it, the web server and PHP are configured for work at once. Simply restart the web server by requesting PHP! Why check out the Apache Monitor (the pen icon with a green arrow in the system tray)

Most of all, when working with scripts, you will need to change the settings in php.ini:

1. When the script is installed, the following message appears:

Pomilkovy error: Maximum execution time of 30 seconds exceeded in C:\blablabla\file.php on line 360

Correction is possible by changing max_execution_time at php.ini

Max_execution_time = 60; Maximum execution time of each script, in seconds

for more meaning

Max_execution_time = 180

2. If large files will be imported through the script, for example, audio and video files, you will need to increase the parameter values upload_max_filesize up to your planned file size

; Maximum size permissions for downloaded files. upload_max_filesize = 100M

5.2K

The php.ini configuration file is the main tool for customizing the PHP kernel. This is important immediately when initializing PHP. If the change is not displayed, do not forget to download and restart httpd. Once you make changes to your settings, check the phpinfo() function to check where php ini is located.

Configuration file for good comments and detailed processing. Parameters are case-sensitive, there is no keyword value; those rows that begin dot-by-bit are ignored. Logical values ​​can be represented as 1/0, Yes/No, On/Off or True/False. The meaning of the settings in php.ini is related to the PHP installation, so that you can adjust it later.

In this article we will look at important adjustments to the php.ini file that may be needed for the PHP parser.

short_open_tag = Off

Short opening tags look like this: . This parameter may be set to Off if you want to use the XML parsing functionality.

safe_mode = Off

Since this parameter is set to ON, it is likely that you have compiled PHP with the enable-safe-mode flag. Safe mode is the most important for CGI wikis.

safe_mode_exec_dir =

This option is less important if Safe Mode is enabled. It can also be installed with the -with-exec-dir command during the Unix installation process. PHP in Safe Mode saves external double files from the same directory. The directory /usr/local/bin is used for promotional purposes. This has nothing to do with the maintenance of the original PHP/HTML web site.

safe_mode_allowed_env_vars =

This php ini option determines which settings can be changed in safe mode. For promotional products, these are the only changes that are added to “PHP_”. Since this directive is empty, most of the items can be changed.

safe_mode_protected_env_vars =

The parameter sets which variables cannot be changed in safe mode when the safe_mode_allowed_env_vars option is checked.

disable_functions =

Add to the following additional features in the PHP4 configuration, which have been preserved and in the PHP5 version, there is the ability to enable selected functions without security restrictions. Previously, it was necessary to manually edit the C code that was written by the PHP interpreter. The functions of the file system, operating system and files may be first on this list, so the ability to write files and change the system via HTTP is not secure.

max_execution_time = 30

When customizing php ini, you need to know that the set_time_limit() function is not available in safe mode. Therefore, this is the main way to implement the shutdown of the script in safe mode. In Windows, it is your fault that Primus completes, running on the maximum level of memory, and not on the clock. You can also adjust the Apache timeout for troubleshooting. But it will be saved to the site files, which is not PHP.

error_reporting = E_ALL & ~E_NOTICE

Meanings for considerations are E_ALL & ~E_NOTICE, all requests are notified. For servers, the minimum value for promotions is set. And on the main servers you can only use less value.

error_prepend_string = [""]

Vikoristavatsya in rows at once, as when forming the value of a form field.

variables_order = EGPCS

Replaces gpc_order. Both versions are out of date from register_globals. This sets the order of the various changes: Environment, GET, POST, COOKIE and SERVER (or Built-in). You can change this order. The changes will be sequentially rewritten from the left side to the right, whereby the one on the right side “wins” in the future. This means that if you deprive the value of washing and selecting one name for a changeable middle, changeable POST and changeable COOKIE, then, by eliminating, they will have a changeable COOKIE.

register_globals = Off

This php ini set parameter allows you to specify whether EGPCS changes need to be registered as global ones. At this time, this method is disabled, and starting with PHP 4.2, this option is set to Off. Instead, vikorist superglobal arrays.

gpc_order = GPC

This parameter is expired.

magic_quotes_gpc = On

Screens the tabs for GET/POST/COOKIE input data. If you use a lot of forms that add data to themselves or other forms, and display the values ​​of the forms, you need to activate this directive or addlashes() function for the row data type.

magic_quotes_runtime = Off

This parameter displays the tabs on the input rows of the database and text rows. Remember that SQL adds slashes and apostrophes when saving rows and does not remove them when rotating rows. If this parameter is enabled, you must use the stripslashes() function when displaying any type of row data from SQL SQL. Since magic_quotes_sybase is set to On, this parameter is set to Off.

magic_quotes_sybase = Off

Displays single tabs in input database rows and text rows with single tabs in the Sybase style rather than a trailing slash. If the magic_quotes_runtime parameter is set to On, this parameter is guilty of error.

auto-prepend-file=

Because of this php ini parameter's instructions, PHP is responsible for automatically adding the include() construct to each PHP file. The next step is to create an exchange for the files that need to be turned on.

auto-append-file=

If this parameter is specified, PHP is required to automatically enter the include() construct at the end of each PHP file, except when exiting the additional exit() function. The next step is to create an exchange for the paths of files to be included.

include_path =

Once you set this value, you will only be allowed to download or download files from the designated directories. The include directory should be located under the root document. This is necessary if you are using safe mode. Set the parameter to .in to hide the files in the directory where your script is located. The folder of directories is divided by two boxes: .:/usr/local/apache/htdocs:/usr/local/lib .

doc_root =

When setting up php ini, if you are using Apache, the httpd.conf file has the root document directory for that server or virtual host. Set this value here if you use secure mode or want to allow PHP only for part of the site (for example, only in one subcatalog).

file_uploads =

Activate this command if you want to add files to an additional PHP script.

upload_tmp_dir =

Don’t delete comments from this row if you don’t know what it is!

session.save-handler = files

In case of single occurrences, you do not need to change this parameter.

ignore_user_abort =

This means what will happen if you open the site and press the “Zupinity” button in your browser. The script is set to On, which means that the script will continue to run until completion or timeout. You can change the value of this parameter to

I am, of course, not a super expert at all things like setting up web servers, apache, php and everything else, so I don’t own a complete server for projects. Tim no less, sometimes in work situations are squandered, if you still have to get into the net and nuances of fine-tuning - today there will be a post about one of them. The background is quite trivial: having started developing the site on typo3, you will need to install ImageMagick to work with images. Well, I’m running back to the hoster, it stinks, but I still can’t do it. Then I find that the exec function is blocked, which ImageMagick requires, so I go back to the hoster. And then there’s the complicated procedure of sending, where I first write a sheet in the hoster’s administration, which is sent to the client by mail and only then I can read the message :)

Zagalom, 3 or 4 days ago I suffered, after which I was directed to the necessary information page, where I knew all the necessary information. As it turned out, I could specify my PHP settings for hosting via php.ini, which, in principle, was a little unimportant.

Also, php.ini is a file for setting up PHP configurations. It has a number of directives that determine different behavior of PHP and, therefore, the site. The name of the file must be such that the interpreter can recognize it. It is written on the Internet that right away it looks for the php.ini file to be configured in the current directory, since there is none, then go to the directory specified in the modified PHPRC, and in the end check the specified compilation ii PHP. It seems that the information is useful, but more theoretical :)

Let's turn to real butts. When working with different hosters, we can say that I had a number of options and nuances for customizing PHP.

1. Since the admin panel is logged into cPanel, there is a section “PHP Configuration” where a list of PHP parameters for hosting is published. Sometimes you can change the PHP version there, since the server allows you to work with 4 or 5 versions.

It is possible that cPanel provides an option to change the PHP setup (other than the version), but this has not yet been done. That's why I mostly go to another option.

2. It’s entirely logical for a freelancer who wouldn’t even dream of asking the hoster for help. There are only one possible solution. Here, perhaps, there is a lot to be learned from changes in the principles of robotic service in various companies - some give their employees more freedom, while others, however, try to control all adjustments.

3. Some hosters trust their desktop clients to allow them to configure their settings in php.ini on the servers. As I understand it, a number of PHP setups are installed at the end of the day, and sometimes situations arise when additional functionality may be needed for these other script systems - as, for example, in my version of the function I exec or if you talk about wordpress, you can remember the memory_limit change.

On one of the hosters, here are the instructions on how you can re-set php.ini settings to suit your needs:

In .htaccess we add the following rows:

#!/bin/sh exec /usr/bin/php -c /home/support/php.ini

Here the path is /home/support/php.ini to your php.ini (of course the php.ini file itself will need to be created there, make sure the path is correct). Following this, the file php5.fcgi has permissions of 755 (chmod 755 php5.fcgi). Now the PHP adjustments will be carried out according to the settings in your php.ini file.

There are 2 clarifications before this instruction. Before creating the php5.fcgi file, you need to change the unix rows to do this. n. If the error is 500, check the error log file and you will find out what the problem is.

Before the speech, to which algorithm one of the correspondents added a comment - and it’s even worse! You can organize everything a little simpler. Everything in the same .htaccess file is connected to your php.ini through special customization:

We save and copy it on FTP hosting in the root directory of the site, after which we launch it. On the main screen, all PHP settings will be displayed, where you can find out the meanings of these and other functions for editing in php.ini. What to add - write in the comments.

P.S. Postoviy. Optimization, promotion and promotion of the site in search engines Google, Yandex.
If you need a clear overview of the site, you can turn to the LTD studio.

How did you install PHP? Apache module, additional possibilities open up before you: you can set the values ​​of various directives directly in files httpd.conf or else .htaccess. Due to the specific syntax of Apache configuration files, you need to use a space character rather than an = sign to qualify the name of a directive with the same value. In addition, names of PHP directives are prefixed with the php_ prefix. For example, the directive in php.ini auto_prepend_file=top.html you will look in httpd.conf or else .htaccess So: php_auto_prepend_file top.html.

The following listing with comments may be sufficient to understand the role of most PHP directives.

php.ini file

;;;;;;;;;;;;;;;;;
; About this file;
;;;;;;;;;;;;;;;;;

; This file contains most PHP parameters. Shchob PHP zmig yogo
; Apparently, it may be called "php.ini". The interpreter looks for the file
; in-line catalysis, in case of failure - in the catalysis specified in
; changeable sharpening of PHPRC, and, will be found in the catalosis specified at
; compilations and folding of PHP (in that order).
; On a Windows system, there are instructions when compiling PHP,
; corresponds to the Windows directory (in most cases this
; c:\windows). The folder in which the search for the file will be located
; "php.ini" can also be assigned to the wiki key –c
; command row.
;
; The file syntax is very simple. Space characters (they are spaced,
; tab characters, etc.), rows that begin with dots (;)
; ignored (as you probably already guessed). Section headings
; (for example, ) are also skipped, perhaps, they will be wrong
; in current versions of PHP.
;
; The directives are set approximately like this:
; directive=value
; Directive names are case sensitive - foo=bar are not the same
; itself, FOO = bar.
;
; The value value can be a row, a number, a PHP constant (for example,
; E_ALL or M_PI), one of the INI constants (On, Off, True, False, Yes, No
; or None), Virase (for example, E_ALL & ~E_NOTICE), and also in a row
; at the paws (“foo”).
;
; Virases may have more than one-by-one and logical
; operators, as well as arms:
; | bit by bit ABO (OR)
; & bitwise I (AND)
; ~ bit by bit NOT (NOT)
; ! logical notation (NOT)
;
; How can the logical meanings of “truth” be
; vikoristano value 1, On, True or Yes. The meaning of "nonsense" is to give 0, Off,
; False and No.
;
; An empty row may contain tasks such as “do not enter anything” after the sign
; equality, or enter the word None:
; foo =; install foo equal empty side
; foo=none; similarly
; foo="none" ; insert foo equal to the row "none"
;
; How do you understand constants as part of the meaning of the directive?
; constants appear in the dynamically enchanted
; extensions (PHP or Zend modules), you can specify them only after
; rows that will benefit from expansion.
;
; All values ​​in the php.ini-dist file correspond to the default values
; for getting ready. If php.ini is not affected, otherwise you will delete it
; rows, values ​​will be established for the production.

;;;;;;;;;;;;;;;;;;;
; Customized movie;
;;;;;;;;;;;;;;;;;;;

; Allows PHP robot for Apache server.
engine = On
; Allows the use of short tags, which is acceptable here.
highlight.string=#DD0000
highlight.comment=#FF8000
highlight.keyword=#007700
highlight.bg=#FFFFFF
highlight.default=#0000BB
highlight.html=#000000
; Other directives
; The next directive states that PHP is responsible for adding a header
; X-Powered-by in the headers, which the browser tries to do, i.e.,
; show yourself. We can’t afford to worry about anything
; the script, however, allows koristuvachev to be significant, and vikorystuvavsya
; Why PHP to generate a page, or no.
expose_php=On

;;;;;;;;;;;;;;;;;;;;;;;;
; Exchange of resources;
;;;;;;;;;;;;;;;;;;;;;;;;

; The maximum possible hour of writing a script in seconds. Yakshcho
; The script will be terminated later, PHP will be completed.
max_execution_time=30
; Maximum memory capacity seen by the script (8MB)
memory_limit=8M


; Processing of benefits and connection;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; The error_reporting directive can be specified in the bit view
; fields. These values ​​can be set using additional constants,
; information provided by the operator | (OR):
; E_ALL - All advances and amends.
; E_ERROR – Critical mercy for the hour of Viconn.
; E_WARNING - Vikonanny is about to arrive.
; E_PARSE – Broadcast parse.
; E_NOTICE - Respect for the hour
; in advance, as we have done for everything,
; talk about logical compromises in
; scenarios - for example, vikoristannya
; uninitialized change).
; E_CORE_ERROR - Critical errors at the start of PHP.
; E_CORE_WARNING – Non-critical delays at the start of PHP.
; E_COMPILE_ERROR – Critical interruptions to the broadcast hour.
; E_COMPILE_WARNING – Ahead of the broadcast hour.
; E_USER_ERROR - Pardons generated by the customer.
; E_USER_WARNING - Generated in advance.
; E_USER_NOTICE - Generated by the correspondent.
; Butt:
; show all the favors, respect the culprit
; error_reporting = E_ALL & ~E_NOTICE
; show more information about the benefits
; error_reporting=E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
; show all the favors, advances and respect
error_reporting = E_ALL
; A friend of yours will do it right next to your browser.
; For ready-made sites, it is recommended to enable the following directive
; replace it with journalism (div. below). Directive included
; display_errors on “working” sites can allow access for clients up to
; classified information: for example, the next way to the document that is being victorious
; databases, etc.
display_errors=On
; Please note that display_errors is turned off, please note that they will go off at the start time
; PHP is not rendered. It is recommended to install such a directive
; at the vimkneniy camp, at the vinyatkom's stand, if you stagnate
; її in good condition.
display_startup_errors=On
; Save notifications about cancellations in the log file. The magazine can
; show that the server is configured, but connected to the stderr stream
; Or use the error_log directive, described below. Yak already
; it is said that in commercial projects it is important to vikoristovat yourself
; logging, rather than displaying notifications in the browser.
log_errors=Off
; Please ensure that you remain informed about the amend or advance notice in
; $php_errormsg
track_errors=On
; The order that is displayed before notification of the pardon.
;error_prepend_string=""
; The row that appears after notification.
;error_append_string=""
; Uncomment to log the specified file.
;error_log=filename;
; Open the system log wiki.
;error_log=syslog
; Press down if the + operator gets stuck in the rows.

;;;;;;;;;;;;;;;;;;;;
; Processing of tributes;
;;;;;;;;;;;;;;;;;;;;

; Note: track_vars is enabled as of PHP 4.0.3.
; The next directive means which order PHP will have
; register data retrieved using GET, POST methods, as well as
; changes are sharpened and changed (obviously, the meanings
; specified by the letters G, P, C, E and S, for example, EGPCS or GPC). Registration
; carried out on the basis of the reading row from left to right, new meaning
; rename the old ones.
variables_order="EGPCS"
; You are responsible for PHP registering EGPCS changes as global ones
; change. Perhaps you want to embrace this potentiality, if not
; want to “see” the global scope of the script. That's it
; Sense, if you are using the track_vars directive - in this case you
; You can access GPC data via the $HTTP_???_VARS array.
; It's important to write scripts in such a way that they stink as much as possible.
; We tried to do without the register_globals directive. Vikoristannya
; data that came from the form, as global changes, potentially
; may cause problems for the script if the programmer is not particularly
; It's about her sleep.
register_globals=On
; This directive tells PHP that it is responsible for making changes
; $argv and $argc based on information found using the GET method. Yakshcho you don't
; Vikorist and change, enable the register_argc_argv directive for
; small speed up robots PHP.
register_argc_argv=On
; The maximum size of POST data that PHP can accept.
post_max_size=8M
; The directive is now outdated - check out variables_order.
gpc_order="GPC"
; Automatic trimming of paws and apostrophes:
; Use auto-feeders for input GET/POST/Cookie data
magic_quotes_gpc=Off
; Why put the tributes in autopaws before the hour of conquest, for example,
; for data from SQL, exec() etc.
magic_quotes_runtime=Off
; You need PHP to design autopaws in Sybase-style (replace "
; to "", not to ""
magic_quotes_sybase=Off
; The current directives indicate PHP, instead of any files, is to blame
; Process before and after the script is displayed.
auto_prepend_file=
auto_append_file=
; Starting with version 4.0b4, PHP will now notify the browser that it has been corrupted.
; coding in the Content-type header. In order to protect the area,
; Just install the empty directive. For the rest
; Text/html without insertion of coding is vikorized.
default_mimetype="text/html"
;default_charset="iso-8859-1"

;;;;;;;;;;;;;;;;;;;
; Ways and catalogues;
;;;;;;;;;;;;;;;;;;;

; For UNIX: "/path1:/path2".
; Windows: "\path1;\path2"
include_path=
; Root directory for PHP scripts.
; Ignored if the value is the same as empty "".
doc_root=
; Directory, which is PHP vikoryst for the script type
; /~username. Do not interfere with the action, since the meaning is old "".
user_dir=
; A directory in which extensions are stored that can be dynamically enlarged.
extension_dir=C:/Program Files/PHP4/extensions
; This directive allows or blocks the use of the dl() function.
; The dl() function does not work correctly on high-threaded Web servers.
; for example, IIS or Zeus, and automatically turns on for them.
enable_dl=On

;;;;;;;;;;;;;;;;;;
; File acquisition;
;;;;;;;;;;;;;;;;;;

; Allows PHP to handle file privacy
file_uploads=On
; Directory for time files, which is required in PHP
; files (the system time clock directory is searched for, as in the directive
; empty row indicated)
;upload_tmp_dir=
; Maximum size of the downloaded file
upload_max_filesize=2M


; Dynamic expansion;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; If you want all modules to be enchanted automatically,
; set the extension directive to the format:
; extension=modulename.extension
; For example, for Windows:
; extension=msql.dll
; or for UNIX:
; extension=msql.so
; Guilty but punished without im'ya, without dorosi. Place it
; directory, which has expanded extensions, vikorista directive
; extension_dir, described above.
; Modules for Windows
; Note: MySQL and ODBC support is now included before the PHP core, so
; it no longer requires DLLs.
;extension=php_cpdf.dll
;extension=php_cybercash.dll
;extension=php_db.dll
;extension=php_dbase.dll
;extension=php_domxml.dll
;extension=php_dotnet.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_gd.dll
;extension=php_gettext.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_java.dll
;extension=php_ldap.dll
;extension=php_mhash.dll
;extension=php_mssql65.dll
;extension=php_mssql70.dll
;extension=php_oci8.dll
;extension=php_oracle.dll
;extension=php_pdf.dll
;extension=php_pgsql.dll
;extension=php_sablot.dll
;extension=php_swf.dll
;extension=php_sybase_ct.dll
;extension=php_zlib.dll

;;;;;;;;;;;;;;;;;;;;;;;;;
; Settings for modules;
;;;;;;;;;;;;;;;;;;;;;;;;;

; It is necessary not to identify various Syslog changes, such as
; $LOG_PID, $LOG_CRON etc. bud. For faster robots it is recommended
; Vimikati will step on the directive. At the hour of finishing the script you
; you can press or press the directive by way of vikliku
; functions define_syslog_variables().
define_syslog_variables=Off

; Only for Win32 – the SMTP server is vikorist.
SMTP=mail.mail.zz
; Only for Win32 – the From field: for details.
sendmail_from= [email protected]
; Only for UNIX - sets the path and arguments of the sendmail program (for
; zamovchuvannyam - "sendmail -t -i").
;sendmail_path=

;debugger.host=localhost
;debugger.port=7869
;debugger.enabled=False

; Advance directives vikorist scenario-example.
; To cancel the reports, div. examples/README.logging.
;logging.method=db
;logging.directory=/path/to/log/directory

;java.class.path=.\php_java.jar
;java.home=c:\jdk
;java.library=c:\jdk\jre\bin\hotspot\jvm.dll
;java.library.path=.\

sql.safe_mode=Off

;uodbc.default_db=Not yet implemented
;uodbc.default_user=Not yet implemented
;uodbc.default_pw=Not yet implemented
; Allows or protects connections
uodbc.allow_persistent=On
; Check the availability of your connection before using wikis.
uodbc.check_persistent=On
; Max. number of durable smears. -1 means there is no boundary.
uodbc.max_persistent=-1
; Max. number of connections (resistant + unstable).
uodbc.max_links=-1
; Settings for LONG irrigation.
uodbc.defaultlrl=4096
; Setting up for binary data. 0 means passthru mode, 1 means
; as is, 2 – transformation into symbols.
uodbc.defaultbinmode=1
; Div. documentation with odbc_binmode and odbc_longreadlen for more
; detailed explanation of the directives uodbc.defaultlrl
; uodbc.defaultbinmode.

mysql.allow_persistent=On
mysql.max_persistent=-1
mysql.max_links=-1
; Standard port for the mysql_connect() function. If not installed, function
; will try to change $MYSQL_TCP_PORT or the mysql-tcp entry
; /etc/services, and also set the PHP compilation time constant
; MYSQL_PORT (in this order). Until PHP for Win32 it’s just a matter of time
; stay.
mysql.default_port=
; Sets the socket name for local MySQL connections. Because there are no tasks,
; Vikoristova vbudovane znachenie za promovchannyam.
mysql.default_socket=
; Standard host for mysql_connect() (does not work safely
modes).
mysql.default_host=
; For cleaning (does not work in safe mode).
mysql.default_user=
; The password is private (does not work in safe mode).
; Note: The idea of ​​saving the password for your file is simple. Whatever
; koristuvach, who can run PHP, can find out the password by the way
; Wyconanny:
; echo cfg_get_var("mysql.default_password")
; Of course, the password can also be found out by the account manager, who has the rights
; for reading the php.ini file.
mysql.default_password=

msql.allow_persistent=On
msql.max_persistent=-1
msql.max_links=-1

pgsql.allow_persistent=On
pgsql.max_persistent=-1
pgsql.max_links=-1

sybase.allow_persistent=On
sybase.max_persistent=-1
sybase.max_links=-1
;sybase.interface_file="/usr/sybase/interfaces"
; The maximum level of seriousness of the pardons that are presented.
sybase.min_error_severity=10
; The minimum level of seriousness of the damages that are displayed.
sybase.min_message_severity=10

; When the directive is set to On, PHP will automatically
; assign a type to the result based on the type in Sybase, instead
; To rearrange the rows of values. This mode
; madness, perhaps, in the future will not be encouraged, so
; Please edit your scripts as needed.
sybase.compatability_mode=Off

sybct.allow_persistent=On
sybct.max_persistent=-1
sybct.max_links=-1
sybct.min_server_severity=10
sybct.min_client_severity=10

; The number of tens digits for all bcmath functions.
bcmath.scale=0

; browscap=extra/browscap.ini

ifx.default_host=
ifx.default_user=
ifx.default_password=
ifx.allow_persistent=On
ifx.max_persistent=-1
ifx.max_links=-1
; When the directive is set to On, the select command is turned
; Instead of a text blob type field, replace your identifier.
ifx.textasvarchar=0
; Use the select command to rotate the field values ​​of the byte blob type
; Substitute your identifier.
ifx.byteasvarchar=0
; I encourage PHP to remove trailing spaces from char columns
; fixed size. You can help the Informix SE community members.
ifx.charasvarchar=0
; Once installed, instead of the text and byte fields, they are saved in the file,
; Instead, in order to preserve memory.
ifx.blobinfile=0
; If 0 is inserted, NULL values ​​are rotated as empty rows,
; Otherwise they rotate like "NULL" rows.
ifx.nullformat=0

; Indicates the mode for saving session data.
session.save_handler=files
; The next directive specifies the argument that is passed to save_handler.
; When saving files, the directory is to blame,
; until the session files will be posted.
session.save_path=C:\Program Files\PHP4\sessiondata
; Chi maє PHP vikoristovati Cookies.
session.use_cookies=1
session.name=PHPSESSID
; Initialize all sessions at startup.
session.auto_start=0
; Lifetime of cookies for the session. If the browser is closed, then 0.
session.cookie_lifetime=0
; The cookie is sent with a session ID.
session.cookie_path=/
; Domain for cookie with session ID.
session.cookie_domain=
; Function for serializing data. The php value is specified
; standard function.
session.serialize_handler=php
; The probability of what happens when the script is run again
; sessions, if you click the "folding message" function to clear the sessions,
; like koristuvach already deprived.
session.gc_probability=1
; After the specified period of saving time
; The data will be deleted automatically by selecting the email.
session.gc_maxlifetime=1440
; Check the HTTP Referer to see if it contains a session ID
; "fake".
session.referer_check=
; Specifies how many bytes to read from the file.
session.entropy_length=0
;session.entropy_length=16
; The file that is used to create session IDs.
session.entropy_file=
;session.entropy_file=/dev/urandom
; Set one of the values ​​nocache, private, public for the value
; aspects of HTTP caching
session.cache_limiter=nocache
; The document will be considered obsolete after the task is completed
; there are a lot of khvylins here
session.cache_expire=180
; Try to support the "transitional" SIDs. Die, yakscho PHP buv
; compilations with the --enable-trans-sid option enabled.
session.use_trans_sid=1

;extension=php_mssql.dll
mssql.allow_persistent=On
mssql.max_persistent=-1
mssql.max_links=-1
mssql.min_error_severity=10
mssql.min_message_severity=10
; Sustainability mode from older versions of PHP 3.0.
mssql.compatability_mode=Off

;assert.active=On
; Generates PHP advances for short-term skin changes
; Viraziv.
;assert.warning=On
; It’s almost impossible for the students to complete the program.
;assert.bail=Off
; The function of the correspondent is to call if the verification fails.
;assert.callback=0
; Calculate virazis in eval from wikis of continuous installations
; error_reporting. Set this to true as you want it to do.
; error_reporting(0) mode was saved when passing through
; cordon eval().
;assert.quiet_eval=0

ingres.allow_persistent=On
ingres.max_persistent=-1
ingres.max_links=-1
; Standard database (format: dbname
ingres.default_database=
ingres.default_user=
ingres.default_password=

pfpro.defaulthost="test.signio.com"
pfpro.defaultport=443
pfpro.defaulttimeout=30
; The IP addresses of the proxy server are specified (as required).
; pfpro.proxyaddress=
; The proxy server port is specified
; pfpro.proxyport=
; Login for the proxy server for instructions
; pfpro.proxylogon=
; The password for the proxy server is private
; pfpro.proxypassword=

At htmlAcademy I am working as a new mentor. Students will intensively have to increase their work precision and this note is aimed at simplifying the task, which is not easy for a newbie. There are different ways to raise a full-fledged LAMP stack, but let’s go the classic way. We can adjust all the components directly (without freezing the finished combines) and finally using PHP (obviously, it will be necessary to look at the finished LAMP assemblies). Since I plan to teach mentors on interests in PHP and beyond, I plan to write similar instructions for repeating other operating systems (Linux, macOS). As it seems, it’s better to sweat once, but then everything will become easier. Hey, let's get started.

Inspired by PHP for Windows

We go to the official website and check the current version of PHP. At the time of writing, the note was 7.1.4. There are a number of distribution options on the page. I have Windows 7 x64, obviously, I choose zip archives from VC14 x64 Thread Safe.

Please note, there are two distribution options available: Thread-Safe (TS) and Non-Thread-Safe (NTS). Choose depending on how you plan to install the interpreter. TS is recommended to be created for one process of web services (for example, configured through the mod_php module for Apache). NTS is recommended for running IIS (Internet Information Service) and alternative FastCGI web servers (for example, Apache with the FastCGI module) and command line.

Install PHP 7.1

It’s time to prepare PHP for comfortable work from the command line. First of all, you have acquired archives from the PHP distribution kit. Unlike most programs, PHP is delivered in a simple archive, and not as an installation package. Then you will have to independently drag files into a directory that is special for you. I choose to save such speeches in the root of the system disk. Create a “php” directory in the root of the “C:” drive (or whatever) and take it from it instead of the archived archive.

The directory will have a lot of files, but we’ll just have to say:

  • go-pear.bat – script for installing PEAR. Details about PEAR can be read in the official documentation.
  • php.exe - allows you to download PHP scripts from the console;
  • php-win.exe – allows you to download PHP scripts without leaving the console;
  • php-cgi.exe – necessary modification of PHP code in FastCGI mode;
  • php7apache2_4.dll – module for integration with the Apache 2.4.X web server;
  • phpdbg.exe - administrator;
  • php.ini-development – ​​​​an example of the PHP configuration file for fine-tuning the development tool
  • php.ini-production – example of the PHP configuration file for production
We include the configuration file

We have unpacked the distribution kit and include a configuration file for it. We are going to run experiments, so let’s take php.ini-development as an example. Make a copy of this file in the php directory (C:\php) named php.ini. IMPORTANT! Make a copy yourself, not just rename it. During the hour of testing, you may need to change the configuration file and there is every chance of making a mistake that is important to reveal.

In such episodes there is nothing beautiful, but it is necessary to turn to standard adjustments. In our case, it is enough to repeat the copy of the php.ini-development file in php.ini . Also, after the file has been completed, the php.ini file will appear in the php directory. In the following notes, we will talk about this in more detail.

Testing PHP from the command line

At this point, the so-called “installation” is completed. Open the console (cmd.exe, the shortcut available in the “Standards” menu) and enter the command:

C:\php\php.exe --version

The result will be something like this:

PHP 7.1.4 (cli) (built: Apr 11 2017 19:54:37) (ZTS MSVC14 (Visual C++ 2015) x64) Copyright (c) 1997-2017 -2017 Zend Technologies

The result confirms that PHP is working. For example, try creating a new script file (I created the “test.php” file right in the root of the “C:” drive) and place the following text in it: