<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>配置 &#8211; LPC影子技术分享</title>
	<atom:link href="https://www.mudbest.com/tag/%E9%85%8D%E7%BD%AE/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.mudbest.com</link>
	<description>行影不离,忘之却步.</description>
	<lastBuildDate>Mon, 11 Mar 2013 11:00:29 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.1</generator>
	<item>
		<title>windows下手动搭建Apache+PHP+MySQL</title>
		<link>https://www.mudbest.com/windows%e4%b8%8b%e6%89%8b%e5%8a%a8%e6%90%ad%e5%bb%baapachephpmysql/</link>
		
		<dc:creator><![CDATA[hkshadow]]></dc:creator>
		<pubDate>Tue, 30 Oct 2012 06:09:37 +0000</pubDate>
				<category><![CDATA[分享]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[下载]]></category>
		<category><![CDATA[安装]]></category>
		<category><![CDATA[配置]]></category>
		<guid isPermaLink="false">http://www.mudbest.com/?p=1642</guid>

					<description><![CDATA[一、下载 http://pan.baidu.com/share/link?shareid=95859&#038 ... <a title="windows下手动搭建Apache+PHP+MySQL" class="read-more" href="https://www.mudbest.com/windows%e4%b8%8b%e6%89%8b%e5%8a%a8%e6%90%ad%e5%bb%baapachephpmysql/" aria-label="阅读 windows下手动搭建Apache+PHP+MySQL">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<p><strong>一、下载</strong><br />
http://pan.baidu.com/share/link?shareid=95859&#038;uk=2349308099</p>
<p><strong>二、安装、解压</strong><br />
 1. Apache</p>
<p>　　主要配置Network Domain、Server Name、Email地址（我依次填的是localhost、localhost、邮箱随意）以及Apache服务的占用端口，默认为80端口，你可以根据需要配置在其他端口，Apache的安装目录你可以使用默认目录或根据需要自行选择安装目录（我安装到 D:\Apache）。<span id="more-1642"></span></p>
<p>　　在完成apache服务的安装后，在游览器中输入http://localhost/，出现It’s work!字样，说明Apache服务安装成功了。</p>
<p>2. PHP</p>
<p>　　只要解压php-5.3.4-Win32-VC6-x86.zip并重名为文件夹为php到某个盘即可完成PHP安装（我是将其解压复制到D盘目录下 D:\web_server\php5.3）</p>
<p> 3. MySQL</p>
<p>　　点击Mysql安装程序自动安装，在此期间你可以根据需要选择Mysql数据库的安装目录（我安装到 D:\web_server\MySQL），MySQL 安装完后会启动向导，你可以先取消，下一部的配置里有说。 </p>
<p><strong>三、配置 </strong><br />
<em><br />
 1. Apache（Apache配置文件httpd.conf在Apache安装目录下的conf文件夹里面）</em></p>
<p>(1)默认Apache服务器执行WEB主程序的目录为Apache2.2/htdocs，所以当你的WEB主程序目录变更时，我们需要修改相应的Apache配置（我改到D:\web_server\apache2.2\htdocs），即用文本编辑软件打开 httpd.conf 将 </p>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
&lt;Directory /&gt;
	Options FollowSymLinks
	AllowOverride None
	Order deny,allow
	Deny from all
&lt;/Directory&gt;
</pre>
<p>将其注释掉</p>
<pre class="brush: plain; title: ; notranslate">
#&lt;Directory /&gt;
#	Options FollowSymLinks
#	AllowOverride None
#	Order deny,allow
#	Deny from all
#&lt;/Directory&gt;
</pre>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
&lt;Directory &quot;D:/web_server/apache2.2/htdocs&quot;&gt;
	#
	# Possible values for the Options directive are &quot;None&quot;, &quot;All&quot;,
	# or any combination of:
	#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
	#
	# Note that &quot;MultiViews&quot; must be named *explicitly* --- &quot;Options All&quot;
	# doesn't give it to you.
	#
	# The Options directive is both complicated and important.  Please see
	# http://httpd.apache.org/docs/2.2/mod/core.html#options
	# for more information.
	#
	Options Indexes FollowSymLinks

	#
	# AllowOverride controls what directives may be placed in .htaccess files.
	# It can be &quot;All&quot;, &quot;None&quot;, or any combination of the keywords:
	#   Options FileInfo AuthConfig Limit
	#
	AllowOverride None

	#
	# Controls who can get stuff from this server.
	#
	Order allow,deny
	Allow from all

&lt;/Directory&gt;
</pre>
<p>将其注释</p>
<pre class="brush: plain; title: ; notranslate">
#&lt;Directory &quot;D:/web_server/apache2.2/htdocs&quot;&gt;
	#
	# Possible values for the Options directive are &quot;None&quot;, &quot;All&quot;,
	# or any combination of:
	#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
	#
	# Note that &quot;MultiViews&quot; must be named *explicitly* --- &quot;Options All&quot;
	# doesn't give it to you.
	#
	# The Options directive is both complicated and important.  Please see
	# http://httpd.apache.org/docs/2.2/mod/core.html#options
	# for more information.
	#
#	Options Indexes FollowSymLinks

	#
	# AllowOverride controls what directives may be placed in .htaccess files.
	# It can be &quot;All&quot;, &quot;None&quot;, or any combination of the keywords:
	#   Options FileInfo AuthConfig Limit
	#
#	AllowOverride None

	#
	# Controls who can get stuff from this server.
	#
#	Order allow,deny
#	Allow from all

#&lt;/Directory&gt;
</pre>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
#Include conf/extra/httpd-vhosts.conf
</pre>
<p>将注释去掉</p>
<pre class="brush: plain; title: ; notranslate">
Include conf/extra/httpd-vhosts.conf
</pre>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
#LoadModule rewrite_module modules/mod_rewrite.so
</pre>
<p>将注释去掉</p>
<pre class="brush: plain; title: ; notranslate">
#LoadModule rewrite_module modules/mod_rewrite.so
</pre>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
</pre>
<p>回车下一行增加以下内容</p>
<pre class="brush: plain; title: ; notranslate">
LoadModule php5_module &quot;D:/web_server/php5.3/php5apache2_2.dll&quot;
PHPIniDir &quot;D:/web_server/php5.3/&quot;
</pre>
<p>说明：在PHP目录下可以看到多个php5apache的DLL文件，由于我使用的是Apache2.2.17，所以我们当然需要使用php5apache2_2.dll，接着指定PHP的安装目录以及执行的程序扩展名。 </p>
<p><em> 2. PHP（配置文件php.ini在PHP安装目录下）</em></p>
<p>(1)把php.ini-development改名为php.ini，然后用文本编辑器修改php.ini，接下来的步骤都是在php.ini进行的。</p>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
; On windows:

; extension_dir = &quot;ext&quot;
</pre>
<p>修改为</p>
<pre class="brush: plain; title: ; notranslate">
; On windows:

extension_dir = &quot;D:/php/ext&quot;
</pre>
<p>表示指定PHP扩展包的具体目录，以便调用相应的DLL文件，这样就不用讲PHP的一些dll和php.ini复制到windows下了。</p>
<p>由于默认PHP并不支持自动连接Mysql，需开启相应的扩展库功能，比如php_mysql.dll等，即将 </p>
<pre class="brush: plain; title: ; notranslate">
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
;
;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_fileinfo.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll 
; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll      ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll  ; Use with Oracle 11gR2 Instant Client
extension=php_openssl.dll
extension=php_pdo_firebird.dll
extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll
extension=php_pdo_oci.dll
extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll

; The MIBS data available in the PHP distribution must be installed. 
; See http://www.php.net/manual/en/snmp.installation.php 
;extension=php_snmp.dll

;extension=php_soap.dll
extension=php_sockets.dll
extension=php_sqlite.dll
extension=php_sqlite3.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
extension=php_xsl.dll
;extension=php_zip.dll

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;
</pre>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
;session.save_path = &quot;/tmp&quot;
</pre>
<p>修改为</p>
<pre class="brush: plain; title: ; notranslate">
session.save_path = &quot;D:/web_server/php5.3/session&quot;
</pre>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
;upload_tmp_dir =
</pre>
<p>修改为</p>
<pre class="brush: plain; title: ; notranslate">
upload_tmp_dir = &quot;D:/web_server/php5.3/temp&quot;
</pre>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
;date.timezone =
</pre>
<p>修改为</p>
<pre class="brush: plain; title: ; notranslate">
date.timezone = &quot;Asia/Shanghai&quot;
</pre>
<p><em>3. MySQL</em><br />
点击开始菜单下Mysql Server5.5菜单中的Mysql Server Instance Config Wizard，完成Mysql的配置向导。</p>
<p>点击 Next》 后出现3个选项：选择Mysql服务器的类型</p>
<p>Developer Machine</p>
<p>Server Machine</p>
<p>Dedicated MySQL Machine</p>
<p>我选第2个“Server Machine”</p>
<p>然后又是3个选项：Mysql数据库用途</p>
<p>Multifunctional Database</p>
<p>Transactional Database Only</p>
<p>Non-Transactional Database Only</p>
<p>我选第1个“Multifunctional Database”</p>
<p>选择Mysql数据库的并发连接数</p>
<p>Decision Support （DSS）/OLAP：最大20个连接并发数</p>
<p>Online Transaction Processing（OLTP）：最大500个并发连接数</p>
<p>Manual Setting：自定义</p>
<p>我选自定义，设置为50</p>
<p>选择Mysql服务的端口号，一般默认即可</p>
<p>选择Mysql数据库的字符集（推荐使用UTF8，比较通用，否则容易造成乱码。）</p>
<p>Standard Character Set</p>
<p>Best Support For Multilingualism</p>
<p>Manual Selected Default Character Set / Collation</p>
<p>我选“Manual Selected Default Character Set / Collation”，然后在 Character Set 选择 utf8</p>
<p>设置Mysql为Windows服务</p>
<p>在这里考虑开机速度的问题，我将自动登录Mysql服务取消了，一般你可以选择此选项，如果没有选，你可以使用net start mysql启动Mysql服务（停止就是net stop mysql）。</p>
<p>我的选择是“Install AS Windows Service”和“Include Bin Directory in Windows PATH”勾选，“Launch the MySQL Server automatically”去掉勾选</p>
<p>设置Mysql数据库root用户的密码</p>
<p>执行Mysql服务配置选项</p>
<p>Mysql数据库的配置文件保存在D:\MySQL\my.ini，如果今后有什么变动，你可以修改此文件。 </p>
<p>到此，所有配置完成。</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>本地开发环境与最终运行环境配置同等是有必要的</title>
		<link>https://www.mudbest.com/%e6%9c%ac%e5%9c%b0%e5%bc%80%e5%8f%91%e4%b8%8e%e8%bf%9c%e7%a8%8b%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%85%8d%e7%bd%ae%e5%90%8c%e7%ad%89%e6%98%af%e5%be%88%e9%87%8d%e8%a6%81%e7%9a%84/</link>
		
		<dc:creator><![CDATA[hkshadow]]></dc:creator>
		<pubDate>Mon, 29 Oct 2012 09:10:28 +0000</pubDate>
				<category><![CDATA[分享]]></category>
		<category><![CDATA[开发]]></category>
		<category><![CDATA[环境]]></category>
		<category><![CDATA[解决]]></category>
		<category><![CDATA[配置]]></category>
		<category><![CDATA[错误]]></category>
		<guid isPermaLink="false">http://www.mudbest.com/?p=1630</guid>

					<description><![CDATA[简单的总结下这几天的工作，从安装系统，到配置环境，完成很顺利，但是配置的环境有差异，由于编码是前人所写，导致出 ... <a title="本地开发环境与最终运行环境配置同等是有必要的" class="read-more" href="https://www.mudbest.com/%e6%9c%ac%e5%9c%b0%e5%bc%80%e5%8f%91%e4%b8%8e%e8%bf%9c%e7%a8%8b%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%85%8d%e7%bd%ae%e5%90%8c%e7%ad%89%e6%98%af%e5%be%88%e9%87%8d%e8%a6%81%e7%9a%84/" aria-label="阅读 本地开发环境与最终运行环境配置同等是有必要的">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<p>简单的总结下这几天的工作，从安装系统，到配置环境，完成很顺利，但是配置的环境有差异，由于编码是前人所写，导致出现各种纠结错误。</p>
<p><strong>前事重现：</strong></p>
<p>系统：ubuntu 12.04<br />
<span id="more-1630"></span><br />
首先搭建 php 环境<br />
所谓LAMP：Linux，Apache，Mysql，PHP</p>
<p>安装 Apache2：</p>
<pre class="brush: plain; title: ; notranslate">
sudo apt-get install apache2
</pre>
<p>安装PHP模块：</p>
<pre class="brush: plain; title: ; notranslate">
sudo apt-get install php5
</pre>
<p>安装Mysql</p>
<pre class="brush: plain; title: ; notranslate">
sudo apt-get install mysql-server
</pre>
<p>其他模块安装：</p>
<pre class="brush: plain; title: ; notranslate">
sudo apt-get install libapache2-mod-php5
sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install php5-mysql
sudo apt-get install php5-gd
</pre>
<p>开启rewrite伪静态模块</p>
<pre class="brush: plain; title: ; notranslate">
sudo a2enmpd rewrite
</pre>
<p>该要的组件都有了就开始配置站点环境了，由于是ubuntu系统，创建步骤可能与他人不一样，直接显示shell命令吧，图就不来了。</p>
<pre class="brush: plain; title: ; notranslate">
cd /etc/apache2/sites-available
cp default web
vim web
</pre>
<p>web文件内容如下:</p>
<pre class="brush: plain; title: ; notranslate">
&lt;VirtualHost *:80&gt;
#需要绑定的域名
ServerName www.tieyou.com
ServerAlias demo.tieyou.com
#管理员邮箱
ServerAdmin hkshadow@demo.com
#网站目录
DocumentRoot &quot;/var/webwork/tieyou/&quot;
#该网站的错误日志
ErrorLog &quot;/var/weblog/tieyou/t.tieyou.com.errors.log&quot;
#该网站的配置日志(如访问)
CustomLog &quot;/var/weblog/tieyou/t.tieyou.com_accesses.log&quot; common
&lt;/VirtualHost&gt;
</pre>
<p>然后退出vim编辑器，生成刚刚创建的站点配置，执行以下命令：</p>
<pre class="brush: plain; title: ; notranslate">
sudo a2ensite web
</pre>
<p>然后重启apache2即可生效(再增加站点同理)：</p>
<pre class="brush: plain; title: ; notranslate">
sudo /etc/init.d/apache2 restart
</pre>
<p>在Ubuntu上装完Apache后，每次启动apache服务器都会得到如下警告：<br />
apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName</p>
<p>注意httpd.conf默认是个空文件<br />
解决方法：</p>
<pre class="brush: plain; title: ; notranslate">
cd /etc/apache2
vi httpd.conf
</pre>
<p>加入以下代码</p>
<pre class="brush: plain; title: ; notranslate">
ServerName localhost
</pre>
<p>配置好web站点以后，以为一切OK，结果发现不是那样的。各种警告迎刃而来。<br />
<strong>php运行时报Use of undefined constant。</strong><br />
解决方法可在php.ini里搜索</p>
<pre class="brush: plain; title: ; notranslate">
vim /etc/php5/apache2/php.ini
</pre>
<p>在文件里搜索：</p>
<pre class="brush: plain; title: ; notranslate">
error_reporting = E_ALL &amp; ~E_DEPRECATED
</pre>
<p>在入口php文件增加error_reporting(0)就可彻底解决这个呕血问题。</p>
<p><strong>有关error_reporting()函数：</strong><br />
error_reporting() 设置 PHP 的报错级别并返回当前级别。</p>
<pre class="brush: plain; title: ; notranslate">
; 错误报告是按位的。或者将数字加起来得到想要的错误报告等级。  
; E_ALL - 所有的错误和警告  
; E_ERROR - 致命性运行时错  
; E_WARNING - 运行时警告（非致命性错）  
; E_PARSE - 编译时解析错误  
; E_NOTICE - 运行时提醒(这些经常是是你的代码的bug引起的，  

;也可能是有意的行为造成的。(如：基于未初始化的变量自动初始化为一个  
　　　　　　　　　　　　　　;空字符串的事实而使用一个未初始化的变量)  

; E_CORE_ERROR - 发生于PHP启动时初始化过程中的致命错误  
; E_CORE_WARNING - 发生于PHP启动时初始化过程中的警告(非致命性错)  
; E_COMPILE_ERROR - 编译时致命性错  
; E_COMPILE_WARNING - 编译时警告(非致命性错)  
; E_USER_ERROR - 用户产生的出错消息  
; E_USER_WARNING - 用户产生的警告消息  
; E_USER_NOTICE - 用户产生的提醒消息  
</pre>
<p>由此可见，开发环境和最终运行环境最好是一样，不然很多悲催的事情发生，需要亡数次修改和调试。到此，开发环境就绪。</p>
<p>附：<br />
perl: warning: Setting locale failed.<br />
perl: warning: Please check that your locale settings:<br />
        LANGUAGE = &#8220;zh_CN:zh&#8221;,<br />
        LC_ALL = (unset),<br />
        LC_PAPER = &#8220;zh_CN&#8221;,<br />
        LC_ADDRESS = &#8220;zh_CN&#8221;,<br />
        LC_MONETARY = &#8220;zh_CN&#8221;,<br />
        LC_NUMERIC = &#8220;zh_CN&#8221;,<br />
        LC_TELEPHONE = &#8220;zh_CN&#8221;,<br />
        LC_IDENTIFICATION = &#8220;zh_CN&#8221;,<br />
        LC_MEASUREMENT = &#8220;zh_CN&#8221;,<br />
        LC_TIME = &#8220;zh_CN&#8221;,<br />
        LC_NAME = &#8220;zh_CN&#8221;,<br />
        LANG = &#8220;zh_CN.UTF-8&#8221;<br />
    are supported and installed on your system.<br />
perl: warning: Falling back to the standard locale (&#8220;C&#8221;).<br />
解决办法：<br />
append following settings in the end of /home/your-login/.bashrc</p>
<pre class="brush: plain; title: ; notranslate">
vi /root/.bashrc
</pre>
<p>再最底部加上</p>
<pre class="brush: plain; title: ; notranslate">
export LANG=en_US:zh_CN.UTF-8
export LC_ALL=C
</pre>
<p>然后执行一下：</p>
<pre class="brush: plain; title: ; notranslate">
source /root/.bashrc 
</pre>
<p>看问题描述，似乎是locale的问题，但从解决办法来看似乎与locale没什么关系。。。</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
