Mac OS X Leopard: Configure Apache, PHP, SQLite, MySQL, and phpMyAdmin (3)

Source: Internet
Author: User
The installation configuration of Apache, PHP, and MySQL is introduced in the first two sections. The installation of phpMyAdmin is more like the installation of a PHP application. I will install a wiki or CMS system later.
Mac OS X Leopard: Configure Apache, PHP, SQLite, MySQL, and phpMyAdmin (1)
Mac OS X Leopard: Configure Apache, PHP, SQLite, MySQL, and phpMyAdmin (2)

Iv. phpMyAdmin
PhpMyAdmin is one of the most popular and active open software for managing MySQL through web. It is my first choice. Although there is a GUI tool used to manage MySQL, however, this tool is still very popular.
1. Download and install:
First, download can go to the official site of download: Group_id = 23067
Because phpMyAdmin is actually written in PHP, it does not rely on hardware and operating systems, but requires your system to support PHP.

I download the zippack with the latest stable version 3.11(your personal questions, in the format of .7z ).

After downloading and decompressing the package, you need to decide how to run it. My choice is to put it in the mysqladmin directory in the documents of APACHE service, so that I can use http: // localhost/mysqladmin/index. PHP to run it.

After the above copy is completed, the installation is complete.
Note that each downloaded and decompressed file contains the quarantine information of OS X Leopard. For how to delete the quarantien, see my previous blog: Quarantine "quarantine" function of leopard.

2. configuration process:
A. correct permissions: Set correct permissions for scritps files. The principle is that the owner is you/Administrator, and the group should be the Apache running group. In leopard, the group name is _ www. for others, you can set it to 0-no access permission.
Because the permissions of all files are not in the _ www group after decompression, you need to change it:
Shell> sudo chown-R: _ www/library/webserver/documents/mysqladmin/
Shell> sudo chmod-r g + XW/library/webserver/documents/mysqladmin/Libraries
In this way, the permissions are set. If you have any questions, please refer to the official documentation FAQ 4.2:

B. Environment Settings:
A. Traditional MethodsIs to manually generate config. inc. PHP file, the system comes with a config. default. inc. PHP file, you can copy it as config. inc. PHP file, and then edit it. I think you can use the following configuration. For security issues, you can:

  1. /* Server: localhost [1] */
  2. $ I ++;
  3. $ Cfg ['servers'] [$ I] ['host'] = 'localhost ';
  4. $ Cfg ['servers'] [$ I] ['Port'] = '';
  5. $ Cfg ['servers'] [$ I] ['sockets '] = '';
  6. $ Cfg ['servers'] [$ I] ['connect _ type'] = 'tcp ';
  7. $ Cfg ['servers'] [$ I] ['extension'] = 'mysqli ';
  8. $ Cfg ['servers'] [$ I] ['auth _ type'] = 'http ';

B. Configuration File Settings:
Use the following method to set the wizard environment. This method is added to the new phpMyAdmin.
Create a Config directory in the mysqladmin directory and grant the correct permissions. Then copy a config. Inc. php file to the config directory:

  1. Shell> Cd/library/webserver/documents/mysqladmin/
  2. Shel> mkdir config
  3. Shell> chmod o + RW config
  4. Shell> CP config. Default. Inc. php config/config. Inc. php
  5. Shell> chmod o + W config/config. Inc. php

Open the browser: Enter http: // localhost/mysqladmin/setup and complete the setting steps. Then, copy the set parameter file to the running environment.

  1. Shell> MV config/config. Inc. php.
  2. Shell> chmod o-RW config. Inc. php

C. Run the test. The following error occurs:
System prompt:Access Denied: #2002-the server is not responding (or the local MySQL server's socket is not correctly configured ).Other errors such:Warning: mysql_connect () http://function.mysql-Connect: Can't connect to local MySQL server through socket '/var/MySQL. Sock'

What should I do? The key to the problem is found through searching and practice: Because the socket file created during the initial running of the new MySQL OS X version is not the previous directory, it is replaced with the/tmp directory, so many programs cannot be found.
One way you can modify the above config. inc. in the PHP file, replace = "" With = "/tmp/MySQL. sock ", but this can only work for phpMyAdmin, other programs will prompt MySQL error.

A better way is to modify the PHP settings that come with OS X, so that programs that apply PHP and obtain MySQL socket from PHP can run without modification.
The modification method is as follows:
Edit the/etc/PHP. ini file in the text and find "mysql_default_socket =" and change it to "mysql_default_socket ="/tmp/MySQL. Sock "to restart Apache. The problem is solved.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.