Home Backend Development PHP Tutorial php zend framework及php虚拟主机 配置

php zend framework及php虚拟主机 配置

Jun 23, 2016 pm 02:29 PM

*************************************************************

*****************zend framework配置****************************

*************************************************************

httpd.conf
1、cmd  进行 netstat -aon|findstr "80"   如果占用,则改端口

  #Listen 12.34.56.78:80
  Listen 80

  >>

  #Listen 12.34.56.78:80
  Listen 8080

2、# LoadModule rewrite_module modules/mod_rewrite.so.  

  注意:是mod_rewrite 前面的"#"去掉
3、文档中所有凡是出现 AllowOverride为None的..请一定把None都改成All.这样你写.htaccess这样的文件才会起到作用..
4、DocumentRoot "C:/wamp/www"   apache 配置虚拟路径   

  注意:请确保路径正确,且路径存在   否则apache不能启动
5、如果此时访问应该会出现权限不够的问题
     所以我们还需应用访问的权限AllowOverride到指定的apache配置的虚拟路径下 
  


php.ini
将library 放置好然后php.ini里配置include  library

; UNIX: "/path1:/path2";include_path = ".:/php/includes";; Windows: "\path1;\path2"include_path = ".;c:\library"
Copy after login


************************************************************

******************apache 虚拟主机配置***************************

************************************************************

1去掉apache httpd.conf下面两句话前面的#

LoadModule vhost_alias_module modules/mod_vhost_alias.so

Include conf/extra/httpd-vhosts.conf

2在C:\Windows\System32\drivers\etc下找到hosts文件

配置

127.0.0.1 tools.localhost

127.0.0.1 website.localhost

3找到C:\wamp\bin\apache\Apache2.2.11\conf\extra下的httpd-vhost.conf文件

配置如下数据

NameVirtualHost *:8080## VirtualHost example:# Almost any Apache directive may go into a VirtualHost container.# The first VirtualHost section is used for all requests that do not# match a ServerName or ServerAlias in any <VirtualHost> block.#<VirtualHost *:8080>  ServerName website.localhost    ServerAdmin webmaster@test.tools.directhr.net    DocumentRoot "C:\Users\n.zhang\Documents\Website\DHR3" <Directory "C:\Users\n.zhang\Documents\Website\DHR3">  Options Indexes MultiViews FollowSymLinks  AllowOverride All  Order allow,deny  Allow from all </Directory>        ErrorLog "logs/test.tools.directhr.net-error.log"    CustomLog "logs/test.tools.directhr.net-access.log" common</VirtualHost><VirtualHost *:8080>  ServerName tools.localhost    ServerAdmin webmaster@test.tools.directhr.net    DocumentRoot "C:\Users\n.zhang\Documents\Tools" <Directory "C:\Users\n.zhang\Documents\Tools">  Options Indexes MultiViews FollowSymLinks  AllowOverride All  Order allow,deny  Allow from all </Directory>        ErrorLog "logs/test.tools.directhr.net-error.log"    CustomLog "logs/test.tools.directhr.net-access.log" common</VirtualHost>
Copy after login


4修改php.ini的下面两个配置(允许上传大文件)

post_max_size = 500M

upload_max_filesize = 500M

5 若root的密码为123456,登录phpmyadmin有一下几种方式
打开C:\wamp\apps\phpmyadmin3.2.0.1下的config.inic.php
【一】使用config授权模式,也是默认的方式
 $cfg['Servers'][$i]['auth_type'] = 'config';   //授权模式
 $cfg['Servers'][$i]['user'] = 'root';           //mysql教程登陆用户
 $cfg['Servers'][$i]['password'] = '123456';    //mysql登陆用户密码
 $cfg['Servers'][$i]['AllowNoPassword'] = true;

 【二】使用cookie授权模式, 需要登录
  将'auth_type'改为'cookie',然后修改'blowfish_secret'用一个任意字符串作为cookie的加密字符串,如果没有加密钥匙,系统会显示"配置文件现在需要绝密的短语密码(blowfish_secret) " ,配置文件如下:
  $cfg['Servers'][$i]['auth_type'] = 'cookie';
  $cfg['blowfish_secret'] = '44e2f5aece2855.93921574'; 

【三】用http授权模式  http授权模式的登陆窗口
 $cfg['Servers'][$i]['auth_type'] = 'http';
  注意事项:如果mysql服务器端采用了4.1以上版本,而客户端连接用的是mysql4.1一下版本,对用户设置密码时注意使用OLD_PASSWORD函数,举例:
 mysql > SET PASSWORD = OLD_PASSWORD('12345')
 mysql > /G
 附录:(以下内容是自己写的)除了上述三种phpmyadmin自带的方法外,还可以使用apache的配置来限制登录,在phpmyadmin目录下放置一个.htaccess文件,指定使用的密码记录文 件。然后用htpasswd来生成密码保存在该密码记录文件中(文件的内容是加密的,使用方法htpasswd /etc/php_passwd username)。
     httpd.conf中的内容:phpmyadmin's directory"> AllowOverride AuthConfig
 .htaccess文件的内容
 authtype basic authuserfile /etc/php_passwd authname information require valid-user
 我们可以看到/etc/php_passwd文件中的内容类似这样:
 username:2Y2CD6nfJuwL6

8

php.ini修改

max_input_time = -1

max_execution_time = -1  

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1255
24
Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1? Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1? Apr 17, 2025 am 12:06 AM

In PHP, password_hash and password_verify functions should be used to implement secure password hashing, and MD5 or SHA1 should not be used. 1) password_hash generates a hash containing salt values ​​to enhance security. 2) Password_verify verify password and ensure security by comparing hash values. 3) MD5 and SHA1 are vulnerable and lack salt values, and are not suitable for modern password security.

PHP: A Key Language for Web Development PHP: A Key Language for Web Development Apr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

How does PHP type hinting work, including scalar types, return types, union types, and nullable types? How does PHP type hinting work, including scalar types, return types, union types, and nullable types? Apr 17, 2025 am 12:25 AM

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values ​​and handle functions that may return null values.

The Enduring Relevance of PHP: Is It Still Alive? The Enduring Relevance of PHP: Is It Still Alive? Apr 14, 2025 am 12:12 AM

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP vs. Other Languages: A Comparison PHP vs. Other Languages: A Comparison Apr 13, 2025 am 12:19 AM

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP and Python: Different Paradigms Explained PHP and Python: Different Paradigms Explained Apr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

See all articles