<?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>php &#8211; 萧邦的博客</title>
	<atom:link href="https://www.zlhlab.top/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.zlhlab.top</link>
	<description>If not me who, If not now when</description>
	<lastBuildDate>Wed, 30 Jul 2025 02:19:19 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.6</generator>
	<item>
		<title>智慧商圈管理后台</title>
		<link>https://www.zlhlab.top/%e6%99%ba%e6%85%a7%e5%95%86%e5%9c%88%e7%ae%a1%e7%90%86%e5%90%8e%e5%8f%b0/</link>
		
		<dc:creator><![CDATA[萧邦]]></dc:creator>
		<pubDate>Fri, 23 Feb 2018 15:44:52 +0000</pubDate>
				<category><![CDATA[案例]]></category>
		<category><![CDATA[软件]]></category>
		<category><![CDATA[Laravel5]]></category>
		<category><![CDATA[php]]></category>
		<guid isPermaLink="false">https://www.zlhlab.top/?p=588</guid>

					<description><![CDATA[项目背景： 在学习Laravel后台开发过程中，产生实现智慧商圈管理后台的想法。如是利用空闲时间，参照以前的设<div class="more-link">
				 <a href="https://www.zlhlab.top/%e6%99%ba%e6%85%a7%e5%95%86%e5%9c%88%e7%ae%a1%e7%90%86%e5%90%8e%e5%8f%b0/" class="link-btn theme-btn"><span>Read More </span> <i class="fa fa-caret-right"></i></a>
			</div>]]></description>
										<content:encoded><![CDATA[<h4>项目背景：</h4>
<p>在学习Laravel后台开发过程中，产生实现智慧商圈管理后台的想法。如是利用空闲时间，参照以前的设计稿，实现商圈管理后台。</p>
<p>前端页面实现注册、登录、验证码功能，首页展示、商品分类、活动详情、购物车，以及支付流程。采用weiui页面框架，展示与微信端保持一致。</p>
<h4>智慧商圈管理后台</h4>
<p>主要包括管理员注册与登录，简单数据统计，广告管理、商家管理、产品管理、文章管理、评论审核、会员管理、标签管理以及订单管理，活动、商家、标签、文章编辑支持mark语法和图片动态插入。</p>
<p>支持提供API接口给前端页面展示。</p>
<p>链接地址：<a href="http://shopsmart.geek720.com/admin/home" title="商圈后台入口" target="_blank">商圈后台入口</a></p>
<p>链接地址：<a href="http://shopsmart.geek720.com/" title="前端展示页面" target="_blank">前端展示页面</a></p>
<h4>项目截图</h4>
<p><strong>后台截图</strong></p>
<p><img decoding="async" src="https://www.zlhlab.top/wp-content/uploads/2018/02/web2.jpg" alt=""><img decoding="async" src="https://www.zlhlab.top/wp-content/uploads/2018/02/web3.jpg" alt=""><img decoding="async" src="https://www.zlhlab.top/wp-content/uploads/2018/02/web4.jpg" alt=""><img decoding="async" src="https://www.zlhlab.top/wp-content/uploads/2018/02/web5.jpg" alt=""><strong>前端页面</strong></p>
<p><img decoding="async" src="https://www.zlhlab.top/wp-content/uploads/2018/02/webapp.jpg" alt=""></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>win10下php版本升级</title>
		<link>https://www.zlhlab.top/win10%e4%b8%8bphp%e7%89%88%e6%9c%ac%e5%8d%87%e7%ba%a7/</link>
		
		<dc:creator><![CDATA[萧邦]]></dc:creator>
		<pubDate>Sun, 24 Sep 2017 15:06:03 +0000</pubDate>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[环境配置]]></category>
		<guid isPermaLink="false">https://www.zlhlab.top/?p=329</guid>

					<description><![CDATA[最近刚完成新的H5项目，于是进入了项目空档期。又开始学习php使用laravel搭建商城后台。 因为公司使用的<div class="more-link">
				 <a href="https://www.zlhlab.top/win10%e4%b8%8bphp%e7%89%88%e6%9c%ac%e5%8d%87%e7%ba%a7/" class="link-btn theme-btn"><span>Read More </span> <i class="fa fa-caret-right"></i></a>
			</div>]]></description>
										<content:encoded><![CDATA[<p>最近刚完成新的H5项目，于是进入了项目空档期。又开始学习php使用<code>laravel</code>搭建商城后台。</p>
<p>因为公司使用的mac电脑，而家里使用的win10系统，通过<code>github</code>备份的代码，在家里<code>pull</code>拉取之后。执行<code>composer install</code>指令，却提示版本过低。原来，<code>laravel5.4</code>需要的<code>php7.0.*</code>+，而当前的window下的php版本<code>php5.6.*</code>。</p>
<p>于是开始进行win10下的php版本升级。</p>
<h3>1. 下载PHP版本文件</h3>
<p>访问<a title="php下载中心" href="http://windows.php.net/download/" target="_blank" rel="noopener">php下载中心</a>，进行window下php下载，最新的php版本是php7.1.9。选择Thread Safe 版本，下载线程安全版本至本地，解压并移动至指定目录。</p>
<h3>2. 修改win10环境变量</h3>
<p>依次打开电脑的控制面板&#8211;&gt;系统&#8211;&gt;高级系统设置&#8211;&gt;环境变量&#8211;&gt;环境变量: path选项&#8211;&gt;增加php路径。如下图：</p>
<p><a title="环境变量" href="https://www.zlhlab.top/wp-content/uploads/2017/09/15062640971.png" target="_blank" rel="noopener"><img decoding="async" title="环境变量" src="https://www.zlhlab.top/wp-content/uploads/2017/09/15062640971.png" alt="环境变量" /></a></p>
<p>多个php版本，新增的php位于最前面。修改完成后，确定保存。</p>
<h3>3. 修改php.ini配置文件</h3>
<p>拷贝<code>php.ini-production</code>文件，修改为<code>php.ini</code>文件并编辑保存。</p>
<ol>
<li>修改<code>extension_dir</code>为<code>E:\XAMPP\php-7.1.9\ext</code>;</li>
<li>屏蔽<code>php_mysql.dll</code>为<code>;extension=php_mysql.dll</code>;</li>
<li>其他问题，根据提示修改。</li>
</ol>
<h3>4. 检测安装情况</h3>
<p>打开phpstorm，执行<code>php -v</code>指令。出现以下信息，即表示php版本更新完成。</p>
<pre class="prism-highlight line-numbers" data-start="1"><code class="language-null">C:\Users\admin\phpStorm\book&gt;php -v
PHP 7.1.9 (cli) (built: Aug 30 2017 18:37:35) ( ZTS MSVC14 (Visual C++ 2015) x86 )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>php+ajax+JSON API实现单页面内标签切换</title>
		<link>https://www.zlhlab.top/phpajaxjson-api%e5%ae%9e%e7%8e%b0%e5%8d%95%e9%a1%b5%e9%9d%a2%e5%86%85%e6%a0%87%e7%ad%be%e5%88%87%e6%8d%a2/</link>
		
		<dc:creator><![CDATA[萧邦]]></dc:creator>
		<pubDate>Tue, 25 Jul 2017 09:27:55 +0000</pubDate>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://www.zlhlab.top/?p=175</guid>

					<description><![CDATA[公司制作新公司的官网，采用wordpress来进行站点搭建。其中首页的案例展示模块，设计如下图： 如上图，需要<div class="more-link">
				 <a href="https://www.zlhlab.top/phpajaxjson-api%e5%ae%9e%e7%8e%b0%e5%8d%95%e9%a1%b5%e9%9d%a2%e5%86%85%e6%a0%87%e7%ad%be%e5%88%87%e6%8d%a2/" class="link-btn theme-btn"><span>Read More </span> <i class="fa fa-caret-right"></i></a>
			</div>]]></description>
										<content:encoded><![CDATA[<p>公司制作新公司的官网，采用wordpress来进行站点搭建。其中首页的案例展示模块，设计如下图：</p>
<figure><img fetchpriority="high" decoding="async" class="aligncenter size-large wp-image-176" src="https://www.zlhlab.top/wp-content/uploads/2017/07/case-1024x482.jpg" alt="" width="1024" height="482" srcset="https://www.zlhlab.top/wp-content/uploads/2017/07/case-1024x482.jpg 1024w, https://www.zlhlab.top/wp-content/uploads/2017/07/case-300x141.jpg 300w, https://www.zlhlab.top/wp-content/uploads/2017/07/case-768x361.jpg 768w, https://www.zlhlab.top/wp-content/uploads/2017/07/case.jpg 1245w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
<p>如上图，需要在首页进行案例的切换。</p>
<p>实现功能想到有两种解决方案：<br />
<strong>方案一</strong>：除index.php文件外，创建三个分类文件category-h5.php、category-media.php、category-design.php，点击标签，跳转到对应的分类页面。基本可以实现标签分页功能。更加精细点，可以缓存当前页面位置，在新的页面设置页面滚动至缓存位置。本方案基本可以实现功能。唯一缺点：页面过渡时根据网络情况会出现闪烁、多3个php文件。</p>
<p><strong>方案二</strong>：单页面index.php，安装JSON API的插件，采用ajax的形式，动态获取分类内容，并动态更新页面内容。</p>
<p>当前采用<strong>方案二</strong>进行技术实现。</p>
<p>1、在wordpress 管理后台创建分类标签，如下图：</p>
<figure><img decoding="async" class="aligncenter size-large wp-image-178" src="https://www.zlhlab.top/wp-content/uploads/2017/07/3BE98391-7D1E-464D-9C29-83ECF442D448-1024x253.png" alt="" width="1024" height="253" srcset="https://www.zlhlab.top/wp-content/uploads/2017/07/3BE98391-7D1E-464D-9C29-83ECF442D448-1024x253.png 1024w, https://www.zlhlab.top/wp-content/uploads/2017/07/3BE98391-7D1E-464D-9C29-83ECF442D448-300x74.png 300w, https://www.zlhlab.top/wp-content/uploads/2017/07/3BE98391-7D1E-464D-9C29-83ECF442D448-768x189.png 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
<p>2、安装<strong>JSON API</strong>插件并启用</p>
<figure><img decoding="async" class="aligncenter size-large wp-image-182" src="https://www.zlhlab.top/wp-content/uploads/2017/07/4FB71529-36E1-4CA7-A7EF-633CE10769E4-1024x84.png" alt="" width="1024" height="84" srcset="https://www.zlhlab.top/wp-content/uploads/2017/07/4FB71529-36E1-4CA7-A7EF-633CE10769E4-1024x84.png 1024w, https://www.zlhlab.top/wp-content/uploads/2017/07/4FB71529-36E1-4CA7-A7EF-633CE10769E4-300x25.png 300w, https://www.zlhlab.top/wp-content/uploads/2017/07/4FB71529-36E1-4CA7-A7EF-633CE10769E4-768x63.png 768w, https://www.zlhlab.top/wp-content/uploads/2017/07/4FB71529-36E1-4CA7-A7EF-633CE10769E4.png 1944w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
<p>3、添加分类文章，测试JSON API</p>
<pre><code>
var clickedItem = 0;
var $items = $('#categoryMenu').find('a');
var slugList = ['case', 'h5', 'media', 'design'];
function clickItem(index) {
     /*更新按钮选项的状态*/
     $($items[clickedItem]).removeClass('hover');
     $($items[index]).addClass('hover');
     clickedItem = index;

     /*请求API，获取分类的内容*/
     var url = '/yanrui/?json=get_category_posts&slug=' + slugList[index] +'&count=6';
     $.ajax({
         type: "GET",
         url: url,
         dataType: "json",
         jsonp: "callback",
         success: function (data) {
             console.log(data);
             var res = eval(data);
             if (res.status == 'ok') {
                  // todo 解析文章内容
             }
         },
         error:function(msg){
             msg = eval('(msg)');
             console.log(msg);
         }
     });
}
</code></pre>
<p>测试结果如下图，即正常接口测试通过：</p>
<figure><img loading="lazy" decoding="async" src="https://www.zlhlab.top/wp-content/uploads/2017/07/2E03463D-3914-4C84-BFA3-DF2E0E282456-1024x725.png" alt="" width="1024" height="725" class="aligncenter size-large wp-image-186" srcset="https://www.zlhlab.top/wp-content/uploads/2017/07/2E03463D-3914-4C84-BFA3-DF2E0E282456-1024x725.png 1024w, https://www.zlhlab.top/wp-content/uploads/2017/07/2E03463D-3914-4C84-BFA3-DF2E0E282456-300x212.png 300w, https://www.zlhlab.top/wp-content/uploads/2017/07/2E03463D-3914-4C84-BFA3-DF2E0E282456-768x544.png 768w, https://www.zlhlab.top/wp-content/uploads/2017/07/2E03463D-3914-4C84-BFA3-DF2E0E282456.png 1590w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<p>4、ajax获取结果，动态更新模块内容</p>
<figure><img loading="lazy" decoding="async" src="https://www.zlhlab.top/wp-content/uploads/2017/07/4973DB30-6006-4C9B-BFC8-E078F60EF7A2-1024x255.png" alt="" width="1024" height="255" class="aligncenter size-large wp-image-205" srcset="https://www.zlhlab.top/wp-content/uploads/2017/07/4973DB30-6006-4C9B-BFC8-E078F60EF7A2-1024x255.png 1024w, https://www.zlhlab.top/wp-content/uploads/2017/07/4973DB30-6006-4C9B-BFC8-E078F60EF7A2-300x75.png 300w, https://www.zlhlab.top/wp-content/uploads/2017/07/4973DB30-6006-4C9B-BFC8-E078F60EF7A2-768x191.png 768w, https://www.zlhlab.top/wp-content/uploads/2017/07/4973DB30-6006-4C9B-BFC8-E078F60EF7A2.png 1880w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<p>5、完成单页面动态切换。</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>阿里云Centos7上搭建LNMP服务器环境</title>
		<link>https://www.zlhlab.top/%e9%98%bf%e9%87%8c%e4%ba%91centos7%e4%b8%8a%e6%90%ad%e5%bb%balnmp%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%8e%af%e5%a2%83/</link>
		
		<dc:creator><![CDATA[萧邦]]></dc:creator>
		<pubDate>Thu, 29 Jun 2017 14:22:05 +0000</pubDate>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<guid isPermaLink="false">https://www.zlhlab.top/?p=149</guid>

					<description><![CDATA[阿里云Centos7上搭建LNMP服务器环境，为个人博客和Laravel商城开发做准备。 安装 1、安装 Ng<div class="more-link">
				 <a href="https://www.zlhlab.top/%e9%98%bf%e9%87%8c%e4%ba%91centos7%e4%b8%8a%e6%90%ad%e5%bb%balnmp%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%8e%af%e5%a2%83/" class="link-btn theme-btn"><span>Read More </span> <i class="fa fa-caret-right"></i></a>
			</div>]]></description>
										<content:encoded><![CDATA[<p>阿里云Centos7上搭建LNMP服务器环境，为个人博客和Laravel商城开发做准备。</p>
<p><strong>安装</strong></p>
<p>1、安装 Nginx :</p>
<pre><code>yum install nginx18 -y</code></pre>
<pre><code>systemctl start nginx.service #启动nginx
systemctl stop nginx.service #停止nginx
systemctl restart nginx.service #重启nginx
systemctl enable nginx.service #设置nginx开机启动
</code></pre>
<p>2、安装MariaDB（CentOS 7.0中，已经使用MariaDB替代了MySQL数据库）</p>
<p>安装</p>
<pre><code>yum install mariadb mariadb-server -y #安装
systemctl start mariadb.service #启动MariaDB
systemctl stop mariadb.service #停止MariaDB
systemctl restart mariadb.service #重启MariaDB
systemctl enable mariadb.service #设置开机启动
</code></pre>
<pre><code>cp /usr/share/mysql/my-huge.cnf /etc/my.cnf #拷贝配置文件（注意：如果/etc目录下面默认有一个my.cnf，直接覆盖即可）
</code></pre>
<p>设置Root密码</p>
<pre><code>mysql_secure_installation
#回车，根据提示输入Y
#输入2次密码，回车
#根据提示一路输入Y
#最后出现：Thanks for using MySQL!
#MariaDB密码设置完成，重新启动 MariaDB：
systemctl restart mariadb.service #重启MariaDB
</code></pre>
<p>3、安装 PHP :</p>
<p>建议将下面插件一次性安装,如mbstring、openssl插件，避免单独安装出现的坑~~！</p>
<pre><code>yum install php71w-fpm php71w-mysql php71w-mysqli php71w php71w-opcache php71w-gd php71w-intl php71w-mbstring php71w-exif php71w-mcrypt php71w-openssl -y
</code></pre>
<p>php服务相关操作</p>
<pre><code>systemctl start php-fpm.service #启动php-fpm
systemctl stop php-fpm.service #停止php-fpm
systemctl restart php-fpm.service #重启php-fpm
systemctl enable php-fpm.service #设置开机启动
</code></pre>
<p><strong>配置</strong></p>
<p>1、配置php-fpm:</p>
<pre><code>vi /etc/php-fpm.d/www.conf

#修改user和group
user = nginx
group = nginx
</code></pre>
<p>2、配置 Nginx:</p>
<pre><code>    server {
        listen       80 default_server;
        # listen       [::]:80 default_server;
        server_name  www.geek720.com;
        # set $root_path        /var/www/laravel/market/public/;
        set $root_path  /var/www/websites/blog;
        root $root_path;
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;
        index   index.html index.htm index.php;

        location / {
            try_files $uri $uri/ /index.php?$query_string;
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
 location ~ \.php {
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index /index.php;

            include /etc/nginx/fastcgi_params;

            fastcgi_split_path_info     ^(.+\.php)(/.+)$;
            fastcgi_param PATH_INFO     $fastcgi_path_info;
            fastcgi_param PATH_TRANSLATED       $document_root$fastcgi_path_info;
            fastcgi_param SCRIPT_FILENAME       $document_root$fastcgi_script_name;
        }

        location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
            root $root_path;
        }

        location ~/\.ht {
            deny all;
        }
    }
</code></pre>
<p>3、重启nginx服务</p>
<pre><code>service nginx restart</code></pre>
<p>4、在配置目录/var/www/websites/blog下，创建测试文件index.php,如能正常访问，则安装正常。</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
