<?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.somedoc.net/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.somedoc.net</link>
	<description>看前面，黑洞洞</description>
	<lastBuildDate>Sat, 09 May 2020 14:47:42 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.1</generator>

<image>
	<url>https://www.somedoc.net/wp-content/uploads/2016/12/cropped-dandycheung-1-32x32.jpg</url>
	<title>php &#8211; 张三太爷</title>
	<link>https://www.somedoc.net</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>PHP 7.4 和 mcrypt</title>
		<link>https://www.somedoc.net/2020/05/09/php-7-4-%e5%92%8c-mcrypt/</link>
					<comments>https://www.somedoc.net/2020/05/09/php-7-4-%e5%92%8c-mcrypt/#respond</comments>
		
		<dc:creator><![CDATA[张三太爷]]></dc:creator>
		<pubDate>Sat, 09 May 2020 13:27:42 +0000</pubDate>
				<category><![CDATA[备忘录]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[问题解决]]></category>
		<category><![CDATA[php]]></category>
		<guid isPermaLink="false">https://www.somedoc.net/?p=4479</guid>

					<description><![CDATA[WordPress 在 PHP 7.4 上运行起来的第一时间 <a href="https://www.somedoc.net/2020/05/09/php-7-4-%e5%92%8c-mcrypt/" class="more-link">[&#8230;]</a>]]></description>
										<content:encoded><![CDATA[<p>WordPress 在 PHP 7.4 上运行起来的第一时间，就用 <code>apt</code> 命令把 PHP 7.2 的相关包全部移除了，然后集中处理 <code>mcrypt</code> 库的问题。</p>
<p>这个库在 7.1 之后的标准操作应该是<a href="https://websiteforstudents.com/install-php-7-2-mcrypt-module-on-ubuntu-18-04-lts/">使用 <code>pecl</code> 安装</a>，但是如果执行 <code>pecl install</code> 或者 <code>pecl update</code> 的话，它都会报已经安装了最新版本。这当然是因为之前 PHP 7.2 存在的时候确实已经安装了最新的 1.0.3 版本的缘故。可见 <code>pecl</code> 对存在 PHP 7.2 和 7.4 两个版本的情况支持不到位。</p>
<p>见招拆招。先 <code>pecl uninstall</code> 掉 <code>mcrypt-1.0.3</code>，然后再 <code>install</code>。这时报一个问题说 <code>phpize</code> 命令未找到。先用 <code>grep</code> 筛了一下 <code>apt list</code> 的结果，里面没有这个关键字。又直接在命令行下执行它，尽管没有，但 shell 提示 <code>php7.2-dev</code> 中有。当然到了这一步，傻子也知道应该装的是 <code>php7.4-dev</code> 了。<code>apt</code> 安装完毕后再执行 <code>pecl</code> 的安装，就马到功成了。</p>
<p>然而刷新站点首页时并没有圆满，报了一堆错，最顶上的异常信息写得分明：<code>Trying to access array offset on value of type bool</code>。说来也巧，昨天在执行 <code>pecl</code> 命令时<a href="https://stackoverflow.com/questions/59720692/php-7-4-1-pear-1-10-10-is-not-working-trying-to-access-array-offset-on-value">正好遇到过这个错</a>，有人给出了解决方案，就是在引用数组元素之前先判定数组本身是有效的（判真即可）。打开出错语句，加上判断后保存，再刷新页面就正常了。</p>
<p>不过这个名为 paperwork 的系统年久失修，功能其实还凑合，但是性能实在太低，还是趁着老夫自己聚焦维护 mindoc 的时机，切换到 mindoc 为佳。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.somedoc.net/2020/05/09/php-7-4-%e5%92%8c-mcrypt/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
