Tag: phpMyAdmin

“Failed - Network error” when exporting from phpMyAdmin (SOLVED)

phpMyAdmin allows ones to export databases and individual tables (as well as individual rows) in the web interface.

In the latest stable version of phpMyAdmin 5.1.3, users encountered a problem when exporting data from tables and databases to a file.

Regardless of the selected settings, instead of downloading the file, an error is shown:

Failed - Network error

This is what the error looks like in a web browser:

This bug has been fixed in phpMyAdmin 5.3, which is available as a snapshot version at the time of writing.

You can download phpMyAdmin 5.3 from the direct link: https://files.phpmyadmin.net/snapshots/phpMyAdmin-5.3+snapshot-all-languages.zip

Or go to the download page of the phpMyAdmin site and select the latest version there: https://www.phpmyadmin.net/downloads/

After unpacking phpMyAdmin in the web server folder, no additional configuration is required - the export of databases and tables works again.

phpMyAdmin error “Deprecation Notice in .\vendor\twig\twig\src\Loader\FilesystemLoader.php#40 realpath(): Passing null to parameter #1 ($path) of type string is deprecated” (SOLVED)

At the time of this writing, the latest release of phpMyAdmin (5.1) is not fully compatible with the latest PHP versions (8.1.1), so the program displays the following deprecated syntax notices:

Deprecation Notice in .\vendor\twig\twig\src\Loader\FilesystemLoader.php#40
 realpath(): Passing null to parameter #1 ($path) of type string is deprecated

Backtrace

.\vendor\twig\twig\src\Loader\FilesystemLoader.php#40: realpath(NULL)
.\libraries\classes\Template.php#57: Twig\Loader\FilesystemLoader->__construct(string 'C:\\Server\\data\\htdocs\\-phpmyadmin\\\\templates\\')
.\libraries\classes\Theme.php#101: PhpMyAdmin\Template->__construct()
.\libraries\classes\Theme.php#174: PhpMyAdmin\Theme->__construct()
.\libraries\classes\ThemeManager.php#307: PhpMyAdmin\Theme::load(
string './themes/metro',
string 'C:\\Server\\data\\htdocs\\-phpmyadmin\\./themes/metro/',
)
.\libraries\classes\ThemeManager.php#79: PhpMyAdmin\ThemeManager->loadThemes()
.\libraries\classes\ThemeManager.php#121: PhpMyAdmin\ThemeManager->__construct()
.\libraries\classes\ThemeManager.php#385: PhpMyAdmin\ThemeManager::getInstance()
.\libraries\common.inc.php#240: PhpMyAdmin\ThemeManager::initializeTheme()
.\index.php#15: require_once(.\libraries\common.inc.php)
Deprecation Notice in .\vendor\twig\twig\src\Markup.php#35
 Return type of Twig\Markup::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Backtrace

.\vendor\composer\ClassLoader.php#444: include(.\vendor\twig\twig\src\Markup.php)
.\vendor\composer\ClassLoader.php#322: Composer\Autoload\includeFile(string 'C:\\Server\\data\\htdocs\\-phpmyadmin\\vendor\\composer/../twig/twig/src/Markup.php')
.\tmp\twig\46\46f1bfbf4328d3d22fddffb9178fdeb9868d0740e4cc8b5bbd6f2fcfb8e4523e.php#59: Composer\Autoload\ClassLoader->loadClass(string 'Twig\\Markup')
.\vendor\twig\twig\src\Template.php#405: __TwigTemplate_034511bee5325c368ee003e3d97d6cb47c3e1c94ebb527bcf0b76ba7818d1ac6->doDisplay(
array,
array,
)
.\vendor\twig\twig\src\Template.php#378: Twig\Template->displayWithErrorHandling(
array,
array,
)
.\vendor\twig\twig\src\Template.php#390: Twig\Template->display(array)
.\vendor\twig\twig\src\TemplateWrapper.php#45: Twig\Template->render(
array,
array,
)
.\libraries\classes\Template.php#132: Twig\TemplateWrapper->render(array)
.\libraries\classes\Header.php#714: PhpMyAdmin\Template->render(
string 'javascript/variables',
array,
)
.\libraries\classes\Header.php#193: PhpMyAdmin\Header->getVariablesForJavaScript()
.\libraries\classes\Header.php#142: PhpMyAdmin\Header->addDefaultScripts()
.\libraries\classes\Response.php#184: PhpMyAdmin\Header->__construct()
.\libraries\classes\Response.php#215: PhpMyAdmin\Response->__construct()
.\libraries\classes\Plugins\Auth\AuthenticationCookie.php#102: PhpMyAdmin\Response::getInstance()
.\libraries\classes\Plugins\AuthenticationPlugin.php#275: PhpMyAdmin\Plugins\Auth\AuthenticationCookie->showLoginForm()
.\libraries\common.inc.php#263: PhpMyAdmin\Plugins\AuthenticationPlugin->authenticate()
.\index.php#15: require_once(.\libraries\common.inc.php)
Deprecation Notice in .\vendor\twig\twig\src\Markup.php#40
 Return type of Twig\Markup::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Backtrace

.\vendor\composer\ClassLoader.php#444: include(.\vendor\twig\twig\src\Markup.php)
.\vendor\composer\ClassLoader.php#322: Composer\Autoload\includeFile(string 'C:\\Server\\data\\htdocs\\-phpmyadmin\\vendor\\composer/../twig/twig/src/Markup.php')
.\tmp\twig\46\46f1bfbf4328d3d22fddffb9178fdeb9868d0740e4cc8b5bbd6f2fcfb8e4523e.php#59: Composer\Autoload\ClassLoader->loadClass(string 'Twig\\Markup')
.\vendor\twig\twig\src\Template.php#405: __TwigTemplate_034511bee5325c368ee003e3d97d6cb47c3e1c94ebb527bcf0b76ba7818d1ac6->doDisplay(
array,
array,
)
.\vendor\twig\twig\src\Template.php#378: Twig\Template->displayWithErrorHandling(
array,
array,
)
.\vendor\twig\twig\src\Template.php#390: Twig\Template->display(array)
.\vendor\twig\twig\src\TemplateWrapper.php#45: Twig\Template->render(
array,
array,
)
.\libraries\classes\Template.php#132: Twig\TemplateWrapper->render(array)
.\libraries\classes\Header.php#714: PhpMyAdmin\Template->render(
string 'javascript/variables',
array,
)
.\libraries\classes\Header.php#193: PhpMyAdmin\Header->getVariablesForJavaScript()
.\libraries\classes\Header.php#142: PhpMyAdmin\Header->addDefaultScripts()
.\libraries\classes\Response.php#184: PhpMyAdmin\Header->__construct()
.\libraries\classes\Response.php#215: PhpMyAdmin\Response->__construct()
.\libraries\classes\Plugins\Auth\AuthenticationCookie.php#102: PhpMyAdmin\Response::getInstance()
.\libraries\classes\Plugins\AuthenticationPlugin.php#275: PhpMyAdmin\Plugins\Auth\AuthenticationCookie->showLoginForm()
.\libraries\common.inc.php#263: PhpMyAdmin\Plugins\AuthenticationPlugin->authenticate()
.\index.php#15: require_once(.\libraries\common.inc.php)

To stop these notifications, you just need to use phpMyAdmin version 5.2 or later. At the moment, this version can be downloaded from the link https://files.phpmyadmin.net/snapshots/phpMyAdmin-5.2+snapshot-all-languages.zip

Error “Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: mysqli, openssl” (SOLVED)

This post explains the causes of the error and how to fix it.

When self-installing the web server on Windows, for example, following the guide “How to install Apache web server with PHP, MySQL and phpMyAdmin on Windows”, when trying to open the phpMyAdmin address, an error may occur:

Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: mysqli, openssl

It occurs in the latest version of phpMyAdmin (for example, in 5.1.1) in the following cases:

1.

The following line is not added to the php.ini file:

extension_dir = "C:\Server\bin\PHP\ext\"

Open the php.ini file and double-check the value of the extension_dir directive. Depending on the folder where you are installing, you may have a different path instead of "C:\Server\bin\PHP\ext\". This value is correct if you install according to the instructions, the link to which is given above.

2.

The following line are commented in the php.ini file:

extension=mysqli
extension=openssl

Check your php.ini file to make sure these lines are uncommented.

3.

Your system for some reason does not use the settings from the php.ini file, for example, because the php.ini file is named incorrectly.

You can check this by running at the command line:

C:\Server\bin\PHP\php --ini

The output should include the path to the file C:\Server\bin\PHP\php.ini. If it is not, you may not have renamed the file to php.ini or named it php.ini.txt or something.

4.

All the settings in the php.ini file are correct, but the web server has not been restarted, which prevented the settings from being applied.

To restart the Apache web server, run the following command (you may have a different path to the executable file):

c:\Server\bin\Apache24\bin\httpd.exe -k restart

Alternatively, restart your computer.

Conclusion

You can think of more exotic reasons, for example, when copying the PHP executable files, the “ext” folder was not copied. But the essence is always the same: PHP is not configured to use the extensions mysqli, openssl – that is, exactly what the error says.

How to install a web server (Apache, PHP, MySQL, phpMyAdmin) on Linux Mint, Ubuntu and Debian

If you are a webmaster, or a PHP programmer, or you just need to run a website on your computer, then you can do it using a web server. On Linux, the web server (Apache) and related components (PHP, MySQL, phpMyAdmin) are installed in just a few commands.

This tutorial will show you how to set up a web server for sites on Linux Mint, Ubuntu and Debian.

How to install Apache, PHP, MySQL, phpMyAdmin on Linux Mint, Ubuntu and Debian

We will do most of the operations in the command line - the Linux terminal.

Open a terminal and run the following two commands in it:

sudo apt update
sudo apt install apache2 default-mysql-server php phpmyadmin

Answer No to the configuration prompt with dbconfig-common:

Use the Tab key to move between items and Enter to continue.

Select “apache2”:

Use the Space key to select items, use the Tab key to move between items, and press Enter to continue.

That's all! The web server (a bunch of Apache, PHP, MySQL, phpMyAdmin) is installed and ready to work. Open the link http://localhost/ in your browser

You will see the standard Apache page:

phpMyAdmin is available at http://localhost/phpmyadmin/

To start the web server every time you turn on the computer, run the command:

sudo systemctl enable apache2
sudo systemctl enable mysql

How to change URL path of phpMyAdmin. How to enable and disable phpMyAdmin

If during the installation of phpMyAdmin you chose not to configure it for use with the Apache web server, use the command to enable phpMyAdmin:

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/

Restart the web server for the changes to take effect:

sudo systemctl restart apache2

To disable phpMyAdmin use the command:

sudo rm /etc/apache2/conf-enabled/phpmyadmin.conf

Restart the web server for the changes to take effect:

sudo systemctl restart apache2

There is an important line in the /etc/phpmyadmin/apache.conf file:

Alias /phpmyadmin /usr/share/phpmyadmin

Its essence is that the URL /phpmyadmin (for example, http://localhost/phpmyadmin) begins to correspond to the /usr/share/phpmyadmin folder. That is, the phpMyAdmin files (scripts) are physically located in /usr/share/phpmyadmin, and not in the web server directory (for example, /var/www/html/).

Many automatic scanners of “hidden” files and folders of a web server and sites check the “phpmyadmin”, “pma” and other similar directories. You can hide your phpMyAdmin nicely by changing the Alias. For instance:

Alias /lkjgler94345 /usr/share/phpmyadmin

phpMyAdmin will now be available at http://localhost/lkjgler94345 - not easy to find.

phpMyAdmin setup

By default phpMyAdmin does not allow login without password. If you have not set a password for the MySQL DBMS, then you have two options to choose from:

  • set password
  • make changes to phpMyAdmin setting to allow passwordless login

It is recommended to set a password for the database. To change the password, you can use the script:

sudo mysql_secure_installation

If you want to allow logging into phpMyAdmin without a password, then open the file

sudo gedit /etc/phpmyadmin/config.inc.php

Find the second (there are two) line

// $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

and uncomment it (remove the two slashes from the beginning of the line) to get:

$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

Most likely, when connecting, you will receive a surprise in the form of the error “#1698 - Access denied for user 'root'@'localhost'”. Step-by-step actions for its solution in this manual.

Where are the sites on the Apache web server?

By default, the root folder for web documents is /var/www/html. In /var/www you can create your own virtual hosts.

The /var/www/html folder and all files inside it belong to the root user.

For you to be able to modify, add, delete files in this folder, you need to use sudo. For example, with the following command, you will open a file manager to manage the contents of a folder.

sudo nemo /var/www/html

All other programs that make changes to /var/www/html must also be run with sudo.

On a local server, for ease of use, you can make yourself the owner of this folder:

sudo chown -R $USER:$USER /var/www/html

Now you and the programs launched on your behalf do not need superuser privileges to work with the contents of this directory:

nemo /var/www/html

Apache index files

If the user requests from the web server not a file, but a directory, then the server looks for files index.html, index.php, index.htm, etc. in it. If these files are in this directory, then their contents are shown. These files are called index files. If there are two or more such files in a directory at once, then one of them is shown in accordance with the set priority.

You can see which files are index files for your server and in what order their priority is arranged in the file

sudo gedit /etc/apache2/mods-enabled/dir.conf

There you will see something like:

<IfModule mod_dir.c>
    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>

Typically, users want to move the PHP index file (index.php) to the first position after DirectoryIndex, so that something looks like this:

<IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>

After making changes, save and close the file, restart the web server.

Conclusion

This tutorial showed you how to install Apache web server on your Linux Mint machine. In terms of its functionality, this server does not differ from the capabilities of hosting. You can test your sites on it, use it when learning PHP, install WordPress, etc. Moreover, this server can be made available to the local or even global network.

How to change default export settings in phpMyAdmin

phpMyAdmin has handy tools for exporting databases or individual tables. All this can be done in the web interface without using the command line.

To export a table, click on its name on the left side of the phpMyAdmin window, and then go to the “Export” tab.

A window with two export methods will be shown:

  • Quick - display only the minimal options
  • Custom - display all possible options

By default, “Quick” is selected and if you press the “Go” button, the file with the database in SQL format without compression will be downloaded.

I think many people have their preferred database export settings, which they change by switching to the “Custom” export option.

For example, with each export, I choose compression for the database, since the size of the databases decreases significantly. This helps to download and upload databases to servers faster, as well as bypass PHP restrictions on the size of the processed file.

I thought, why not make compression (or any other setting you need) the default option, so that without switching to the “Custom” export method, download a table or database with one click?

It turned out to be quite simple!

Go to the export tab and click that gear in the corner:

A window will open in which you can set any default settings. For example, I chose to use zip compression by default. When everything is ready, click the “Apply” button.

That's all! Now every time you export a database or table to phpMyAdmin it will be compressed into an archive, or any other default settings of your choice will be applied.

Password and unix_socket authentication in MySQL and MariaDB. Error “#1698 - Access denied for user ‘root’@’localhost’” (SOLVED)

How to fix #1698 - Access denied for user ‘root’@’localhost’

In the latest versions of MariaDB (possibly MySQL), unix_socket authentication is used by default. If you are not familiar with it, then you might have encountered the error “#1698 - Access denied for user ‘root’@’localhost’”.

Let's take a look at what unix_socket authentication is in MySQL and MariaDB, and how to fix bug #1698.

MySQL and MariaDB unix_socket authentication

The essence of unix_socket authentication is that if the user has already logged into the system, then he does not need to enter a password when connecting to the DBMS, since his authenticity has already been verified when logging into the OS.

In practice, most people work as a regular user and connect to MySQL as root. As a result, the above error occurs.

You can choose one of the options:

1. Always use sudo when connecting as root.

2. Make changes to the MySQL settings so that ordinary users can connect to the DBMS.

3. Create a MySQL user with the same name as your system username

How to check which authentication method is being used

To view the used authentication method, you can use the following SQL query:

select * from mysql.global_priv where User='root';

Or this, for greater clarity of the output:

SELECT CONCAT(user, '@', host, ' => ', JSON_DETAILED(priv)) FROM mysql.global_priv where user='root';

You can see that mysql_native_password and unix_socket are set as plugin:

{
    "access": 18446744073709551615,
    "plugin": "mysql_native_password",
    "authentication_string": "invalid",
    "auth_or": 
    [
        
        {
        },
        
        {
            "plugin": "unix_socket"
        }
    ]
} 

With this configuration, only unix_socket authentication worked for me.

Enabling and disabling unix_socket authentication

You can switch to password authentication with the following SQL query:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'PASSWORD';

Please note that you need to enter the PASSWORD.

To switch to unix_socket authentication, execute the following SQL query:

ALTER USER 'root'@'localhost' IDENTIFIED VIA unix_socket;

Let's check:

SELECT plugin from mysql.user where User='root';

If mysql_native_password is output, it means that password login is being used.

In fact, unix_socket authentication can be combined with password authentication, but I will not dwell on that.

Replacement for “update user set plugin='' where User='root';”

Previously, a similar effect - changing authentication from unix_socket to password authentication - was achieved using a sequence of commands:

Connecting to MySQL Server:

sudo mysql

At the MySQL prompt, you had to run the commands:

use mysql;
update user set plugin='' where User='root';
flush privileges;
exit

Then the service had to be restarted:

sudo systemctl restart mysql.service

And it was possible to connect without sudo.

mysql -u root -p

In the case shown above, the authentication method was also changed from unix_socket to password, but the new password was not set. If you want the same effect (although it becomes insecure after disabling authentication with unix_socket), then you can run the following requests (i.e. set an empty password):

use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED BY '';
exit

Choosing an authentication method when creating a user

You can create a user with password authentication with an SQL query of the following form:

CREATE USER USERNAME@HOST IDENTIFIED BY 'PASSWORD';

To create a user with unix_socket authentication, execute the following SQL query:

CREATE USER USER@HOST IDENTIFIED VIA unix_socket;

How to install Apache web server with PHP, MySQL and phpMyAdmin on Windows

Table of contents

1. Windows web server

2. How to install Apache on Windows

3. How to install PHP on Windows

4. PHP 8 setup

5. How to install MySQL on Windows

6. How to install phpMyAdmin on Windows

Conclusion


Windows web server

A web server is a program that is designed to process requests for websites and send website pages to users. The most popular example of a web server is Apache.

PHP is a programming language. Also, it called an environment for executing scripts written in PHP. In operating systems, including Windows, PHP can be installed independently, without a web server. In this case, programs (scripts) in PHP can be run from the command line. But web applications use PHP very often, this interpreter has become, in fact, the standard for web servers and therefore they are almost always installed together.

MySQL is a database management system (DBMS). It is also a standalone program, it is used to store data, search databases, modify and delete data. Web applications need persistent storage, so a DBMS is additionally installed for the web server. By the way, it is quite possible that you have heard about MariaDB - this is also a DBMS. MySQL came first, and then MariaDB forked from it. For web applications, both of these DBMS are interchangeable, that is, there is no difference. In this tutorial I will show the installation using MySQL as an example.

As for phpMyAdmin, this is just a PHP script that is designed to work with databases - it visually displays their contents, allows you to perform tasks in the graphical interface such as creating databases, creating tables, adding, changing and deleting information, etc. For this reason phpMyAdmin is quite popular, although it is not a required part of the web server.

The peculiarity of Apache and other web server components is that they have their roots in Linux. And these programs apply the basic concepts of this operating system in their work. For example, programs are very flexible in customization - you can install in any folder, sites can also be placed in any folder, including on another drive, not on the one where the web server itself is installed. Even the log files can be moved to the third disk and so on. The web server has many built-in modules - you can enable or disable them in any combination, you can add external modules. You can create many sites on the same web server and customize each site. But this flexible setting is done through text files - this is the approach (without a graphical interface) that allows you to describe any configuration

Do not be afraid of this - I will tell you what files need to be edited and what exactly to write in them.

We will not do any complex settings - our goal is just to install the web server on Windows. However, it would be strange not to use that kind of power in tuning at all. We will split the server into two directories: the first will contain executable files, and the second will contain data (website and database files). In the future, when the need arises to make backups of information or update the web server, you will understand how convenient this approach is!

We will install the server in a separate directory. To do this, create the “Server” directory in the root of the C:\ drive. Create 2 subdirectories in this directory: “bin” (for executable files) and “data” (for sites and databases).

Go to the “data” directory and create subfolders “DB” (for databases) and “htdocs” (for web sites) there.

Go to the “C:\Server\data\DB\” directory and create an empty “data” folder there.

For the operation of all components of the web server, the file “Visual C++ Redistributable for Visual Studio 2015-2019" is required - this is the official file from Microsoft. To download it follow the link. After downloading, run this file and complete the installation.

The preparatory steps are completed, we proceed to the installation of the web server components.

How to install Apache on Windows

Go to apachelounge.com/download and download the .zip archive with the web server:

Unpack the “Apache24” folder from this archive to “C:\Server\bin\”.

Go to the “C:\Server\bin\Apache24\conf\” directory and open the httpd.conf file with any text editor.

In it, we need to replace a number of lines.

Change

Define SRVROOT "c:/Apache24"

on

Define SRVROOT "c:/Server/bin/Apache24"

change

#ServerName www.example.com:80

on

ServerName localhost

change

DocumentRoot "${SRVROOT}/htdocs"
<Directory "${SRVROOT}/htdocs">

on

DocumentRoot "c:/Server/data/htdocs"
<Directory "c:/Server/data/htdocs">

change

DirectoryIndex index.html

on

DirectoryIndex index.php index.html index.htm

change

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None

on

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All

and change

#LoadModule rewrite_module modules/mod_rewrite.so

on

LoadModule rewrite_module modules/mod_rewrite.so

We save and close the file. That's it, Apache configuration is complete!

Open a command prompt (you can do this by pressing the Win+x keys at the same time). 

Select Windows PowerShell (Admin) there and copy there:

c:\Server\bin\Apache24\bin\httpd.exe -k install

Press Enter.

If you get a request from the firewall regarding Apache, then click Allow access.

Now we enter into the command line:

c:\Server\bin\Apache24\bin\httpd.exe -k start

And press Enter.

Now in the browser, type http://localhost/ and see the following:

This means the web server is running. To see the files there, add them to the c:\Server\data\htdocs\ directory - this is the main folder for the server data, where all sites will be located.

How to install PHP on Windows

Download PHP 8 from windows.php.net/download. Choose Thread Safe version, pay attention to select 64-bit computer architecture.

In the c:\Server\bin\ folder, create a “PHP” directory and copy the contents of the just downloaded archive into it.

In the file c:\Server\bin\Apache24\conf\httpd.conf at the very end we add the lines:

PHPIniDir "C:/Server/bin/PHP"
AddHandler application/x-httpd-php .php
LoadModule php_module "C:/Server/bin/php/php8apache2_4.dll"

And restart Apache:

c:\Server\bin\Apache24\bin\httpd.exe -k restart

In the c:\Server\data\htdocs\ directory, create a file called i.php, copy it to this file:

<?php
phpinfo ();

In your browser, open the link http://localhost/i.php. If you see something similar, then PHP is working:

PHP 8 setup

PHP is configured in the php.ini file. There is no php.ini in the zip archives intended for manual installation and for updates (this is done on purpose so that you do not accidentally delete your settings file during the update). But there are two others called php.ini-development and php.ini-production. Any of them, during manual installation, can be renamed to php.ini and further configured. On the localhost we will use php.ini-development.

Open the php.ini file with any text editor, looking for the line

;extension_dir = "ext"

and replace it with

extension_dir = "C:\Server\bin\PHP\ext\"

Now find the line group:

;extension=bz2
;extension=curl
;extension=ffi
;extension=ftp
;extension=fileinfo
;extension=gd
;extension=gettext
;extension=gmp
;extension=intl
;extension=imap
;extension=ldap
;extension=mbstring
;extension=exif      ; Must be after mbstring as it depends on it
;extension=mysqli
;extension=oci8_12c  ; Use with Oracle Database 12c Instant Client
;extension=oci8_19  ; Use with Oracle Database 19 Instant Client
;extension=odbc
;extension=openssl
;extension=pdo_firebird
;extension=pdo_mysql
;extension=pdo_oci
;extension=pdo_odbc
;extension=pdo_pgsql
;extension=pdo_sqlite
;extension=pgsql
;extension=shmop

and replace it with:

extension=bz2
extension=curl
extension=ffi
extension=ftp
extension=fileinfo
extension=gd
extension=gettext
extension=gmp
extension=intl
extension=imap
extension=ldap
extension=mbstring
extension=exif      ; Must be after mbstring as it depends on it
extension=mysqli
;extension=oci8_12c  ; Use with Oracle Database 12c Instant Client
extension=odbc
extension=openssl
;extension=pdo_firebird
extension=pdo_mysql
;extension=pdo_oci
extension=pdo_odbc
extension=pdo_pgsql
extension=pdo_sqlite
extension=pgsql
extension=shmop

now uncomment this line group:

;extension=soap
;extension=sockets
;extension=sodium
;extension=sqlite3
;extension=tidy
;extension=xsl 

it should look like this:

extension=soap
extension=sockets
extension=sodium
extension=sqlite3
extension=tidy
extension=xsl

With these actions, we enabled the extensions. They may be needed in different situations for different scripts. Save the file and restart Apache.

c:\Server\bin\Apache24\bin\httpd.exe -k restart

It is highly recommended to add the path to PHP to your “PATH” environment variable on Windows.

Related: How to add PHP path to %PATH% environment variable on Windows

How to install MySQL on Windows

The free version of MySQL is called MySQL Community Server. It can be downloaded from https://dev.mysql.com/downloads/mysql/. There is an executable installer on the same page, but I recommend downloading the ZIP archive.

On the download page, we are offered to register or log into an existing account - but this is optional. Just click on the link “No thanks, just start my download”.

Unpack the files from the just downloaded archive into the c:\Server\bin\ directory. The unpacked folder will be named approximately mysql-8.0.23-winx64 (depending on the version), rename it to mysql-8.0.

We go into this folder and create the my.ini file there. Now open this file with any text editor and add the following lines there:

[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
datadir="c:/Server/data/DB/data/"
default_authentication_plugin=mysql_native_password

Save and close it.

The configuration is complete, but you still need to perform the initialization and installation, for this we open the command line as administrator and sequentially enter there:

C:\Server\bin\mysql-8.0\bin\mysqld --initialize-insecure --user=root
C:\Server\bin\mysql-8.0\bin\mysqld --install
net start mysql

At the end of this process, the automatically generated files should appear in the C:\Server\data\DB\data\ directory.

The MySQL service will now start every time Windows starts.

How to install phpMyAdmin on Windows

The phpMyAdmin download site is phpmyadmin.net.

Direct link to the most recent version: phpMyAdmin-latest-all-languages.zip.

Copy the contents of the just downloaded archive to the c:\Server\data\htdocs\ directory. Rename this folder to “phpmyadmin”.

In the c:\Server\data\htdocs\phpmyadmin\ directory, create a config.inc.php file and copy there:

<?php

/* Servers configuration */
$i = 0;

/* Server: localhost [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['nopassword'] = true;
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/* End of servers configuration */

$cfg['blowfish_secret'] = 'kjLGJ8g;Hj3mlHy+Gd~FE3mN{gIATs^1lX+T=KVYv{ubK*U0V';
$cfg['DefaultLang'] = 'en';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

?>

In the browser, type http://localhost/phpmyadmin/

Enter root as the username. Leave the password field blank.

Conclusion

That's it - you now have your own personal local web server on your home computer.

If suddenly something didn't work out for you, then most likely you missed a step or did it incorrectly - try to do everything exactly according to the instructions. If the problem persists, then write about your error in the comments.

Loading...
X