<?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>Techy Things &#187; php</title>
	<atom:link href="https://tech.yipp.ca/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://tech.yipp.ca</link>
	<description>Just another Yipp.ca Blogs site</description>
	<lastBuildDate>Thu, 01 May 2025 18:06:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.38</generator>
	<item>
		<title>syntax error, unexpected &#039;use&#039; (T_USE), expecting &#039;{&#039;</title>
		<link>https://tech.yipp.ca/php/syntax-error-unexpected-use-t_use-expecting/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=syntax-error-unexpected-use-t_use-expecting</link>
		<comments>https://tech.yipp.ca/php/syntax-error-unexpected-use-t_use-expecting/#comments</comments>
		<pubDate>Sat, 01 Jan 2022 22:50:06 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=4119</guid>
		<description><![CDATA[<p>Problem syntax error, unexpected 'use' (T_USE), expecting '{' Code function fetchSumWithExplain($schemaTableName, $tag) use ($app) { $generateExplain = function ($sql, $header) use ($app) { $query = $app-&#62;db-&#62;prepare($sql); $query-&#62;execute(); $sqlData = $query-&#62;fetchAll(PDO::FETCH_ASSOC); $retVal = array_merge(array($header),$sqlData); return&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/syntax-error-unexpected-use-t_use-expecting/">syntax error, unexpected 'use' (T_USE), expecting '{'</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h3>Problem</h3>
<p>syntax error, unexpected 'use' (T_USE), expecting '{'</p>
<h3>Code</h3>
<pre>function fetchSumWithExplain($schemaTableName, $tag) use ($app)
{
   $generateExplain = function ($sql, $header) use ($app) {
      $query = $app-&gt;db-&gt;prepare($sql);
      $query-&gt;execute();
      $sqlData = $query-&gt;fetchAll(PDO::FETCH_ASSOC);
      $retVal = array_merge(array($header),$sqlData);
      return $retVal;
   };

   $sql = "SELECT SUM(price) as price, (SUM(tvq)+SUM(tps)) as taxes FROM `$schemaTableName` WHERE revenue = 0 AND type = {$tag}";
   $sql_explain = "SELECT id, name, total, tps, tvq, price, description, date FROM `$schemaTableName` WHERE revenue = 0 AND type = {$tag}";
   $query = $app-&gt;db-&gt;prepare($sql);
   $query-&gt;execute();
   $sqlData = $query-&gt;fetch(PDO::FETCH_ASSOC);
   $line = floatval($sqlData['price']);
   $explanation = $generateExplain($sql_explain, array("name", "total", "tps", "tvq", "price", "description", "date"));
   return array($line, $explanation);
}
</pre>
<h3>Solution</h3>
<p>Only <a href="http://www.php.net/manual/en/functions.anonymous.php">anonymous functions</a> may have declare a <code>use</code> statement. So either switch the function to a $variable = function(...) use (...) or pass the $app as a parameter, or as declare as global.</p>
<pre>function fetchSumWithExplain($app, $schemaTableName, $tag)</pre>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/syntax-error-unexpected-use-t_use-expecting/">syntax error, unexpected 'use' (T_USE), expecting '{'</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/php/syntax-error-unexpected-use-t_use-expecting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Vision SSL certificate problem: unable to get local issuer certificate</title>
		<link>https://tech.yipp.ca/google-vision/google-vision-ssl-certificate-problem-unable-get-local-issuer-certificate/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=google-vision-ssl-certificate-problem-unable-get-local-issuer-certificate</link>
		<comments>https://tech.yipp.ca/google-vision/google-vision-ssl-certificate-problem-unable-get-local-issuer-certificate/#comments</comments>
		<pubDate>Sun, 10 Oct 2021 00:05:01 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[google vision]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=4082</guid>
		<description><![CDATA[<p>GuzzleHttp\Exception\RequestException Message: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) Solution In php.ini add or uncomment the line curl.cainfo : [curl] ; A default value for the CURLOPT_CAINFO option.&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/google-vision/google-vision-ssl-certificate-problem-unable-get-local-issuer-certificate/">Google Vision SSL certificate problem: unable to get local issuer certificate</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>GuzzleHttp\Exception\RequestException<br />
<strong>Message:</strong> cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)</p>
<h2>Solution</h2>
<p>In php.ini add or uncomment the line curl.cainfo :</p>
<pre>[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = C:\php-7.4.21\cacert.pem
</pre>
<p>Download the latest <a href="https://curl.se/ca/cacert.pem">cacert.pem</a> at <a href="https://curl.se/ca/cacert.pem">https://curl.se/ca/cacert.pem</a></p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/google-vision/google-vision-ssl-certificate-problem-unable-get-local-issuer-certificate/">Google Vision SSL certificate problem: unable to get local issuer certificate</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/google-vision/google-vision-ssl-certificate-problem-unable-get-local-issuer-certificate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpoffice/phpspreadsheet 1.17.1 requires ext-gd * -&gt; it is missing from your system. Install or enable PHP&#039;s gd extension.</title>
		<link>https://tech.yipp.ca/php/phpofficephpspreadsheet-1-17-1-requires-ext-gd-missing-system-install-enable-phps-gd-extension/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=phpofficephpspreadsheet-1-17-1-requires-ext-gd-missing-system-install-enable-phps-gd-extension</link>
		<comments>https://tech.yipp.ca/php/phpofficephpspreadsheet-1-17-1-requires-ext-gd-missing-system-install-enable-phps-gd-extension/#comments</comments>
		<pubDate>Sat, 14 Aug 2021 16:17:46 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=4054</guid>
		<description><![CDATA[<p>This is with PHP 7.4 Your requirements could not be resolved to an installable set of packages. Problem 1 - phpoffice/phpspreadsheet is locked to version 1.17.1 and an update of this package was not&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/phpofficephpspreadsheet-1-17-1-requires-ext-gd-missing-system-install-enable-phps-gd-extension/">phpoffice/phpspreadsheet 1.17.1 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>This is with PHP 7.4</p>
<p>Your requirements could not be resolved to an installable set of packages.</p>
<p>  Problem 1<br />
    - phpoffice/phpspreadsheet is locked to version 1.17.1 and an update of this package was not requested.<br />
    - phpoffice/phpspreadsheet 1.17.1 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.   </p>
<p>The problem is I enable gd2, and it still doesn't work. Why does it ask for an non-existing gd extension?</p>
<p><a href="http://tech.yipp.ca/files/2021/08/gd-required.png"><img src="http://tech.yipp.ca/files/2021/08/gd-required-800x171.png" alt="gd-required" width="720" height="154" class="alignnone size-large wp-image-4056" /></a></p>
<p>I don't know how to fix it, please help !</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/phpofficephpspreadsheet-1-17-1-requires-ext-gd-missing-system-install-enable-phps-gd-extension/">phpoffice/phpspreadsheet 1.17.1 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/php/phpofficephpspreadsheet-1-17-1-requires-ext-gd-missing-system-install-enable-phps-gd-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install PHP Debug with XDebug on Windows for Visual Studio Code</title>
		<link>https://tech.yipp.ca/php/install-php-debug-xdebug-windows-visual-studio-code/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=install-php-debug-xdebug-windows-visual-studio-code</link>
		<comments>https://tech.yipp.ca/php/install-php-debug-xdebug-windows-visual-studio-code/#comments</comments>
		<pubDate>Sat, 31 Jul 2021 16:06:54 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=4043</guid>
		<description><![CDATA[<p>&#160; If I follow exactly the instructions in the output of my analyzed at https://xdebug.org/wizard, I get this error (wtf!) : php -i &#62; php.txt PHP Warning: Failed loading Zend extension 'ext\php_xdebug-3.0.4-7.4-vc15-nts-x86_64.dll' (tried: ext\ext\php_xdebug-3.0.4-7.4-vc15-nts-x86_64.dll&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/install-php-debug-xdebug-windows-visual-studio-code/">Install PHP Debug with XDebug on Windows for Visual Studio Code</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>&nbsp;</p>
<p>If I follow exactly the instructions in the output of my analyzed at https://xdebug.org/wizard, I get this error (wtf!) :</p>
<p>php -i &gt; php.txt<br />
PHP Warning: Failed loading Zend extension 'ext\php_xdebug-3.0.4-7.4-vc15-nts-x86_64.dll' (tried: ext\ext\php_xdebug-3.0.4-7.4-vc15-nts-x86_64.dll (The specified module could not be found.), ext\php_ext\php_xdebug-3.0.4-7.4-vc15-nts-x86_64.dll.dll (The specified module could not be found.)) in Unknown on line 0</p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/install-php-debug-xdebug-windows-visual-studio-code/">Install PHP Debug with XDebug on Windows for Visual Studio Code</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/php/install-php-debug-xdebug-windows-visual-studio-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Message: Class &#039;Hybridauth\Hybridauth&#039; not found</title>
		<link>https://tech.yipp.ca/php/message-class-hybridauthhybridauth-found/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=message-class-hybridauthhybridauth-found</link>
		<comments>https://tech.yipp.ca/php/message-class-hybridauthhybridauth-found/#comments</comments>
		<pubDate>Wed, 21 Apr 2021 03:00:13 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=3950</guid>
		<description><![CDATA[<p>Error "Message: Class 'Hybridauth\Hybridauth' not found" When trying to login via Hybridauth. Solution Upgrade from Hybridauth 2.X to 3.X to fix this error Reference https://gitter.im/hybridauth/hybridauth?at=5c97d377a21ce51a20b4dc8f &#160;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/message-class-hybridauthhybridauth-found/">Message: Class 'Hybridauth\Hybridauth' not found</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Error "Message: Class 'Hybridauth\Hybridauth' not found"</p>
<p>When trying to login via Hybridauth.</p>
<h2>Solution</h2>
<p>Upgrade from Hybridauth 2.X to 3.X to fix this error</p>
<h3>Reference</h3>
<p>https://gitter.im/hybridauth/hybridauth?at=5c97d377a21ce51a20b4dc8f</p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/message-class-hybridauthhybridauth-found/">Message: Class 'Hybridauth\Hybridauth' not found</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/php/message-class-hybridauthhybridauth-found/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uncaught PDOException: could not find driver</title>
		<link>https://tech.yipp.ca/php/uncaught-pdoexception-find-driver/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=uncaught-pdoexception-find-driver</link>
		<comments>https://tech.yipp.ca/php/uncaught-pdoexception-find-driver/#comments</comments>
		<pubDate>Thu, 25 Mar 2021 22:46:06 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=3909</guid>
		<description><![CDATA[<p>Fatal error: Uncaught PDOException: could not find driver in U:\Webpages\thecanadianhosting.co\app\src\db.inc.php:26 Stack trace: #0 U:\Webpages\thecanadianhosting.co\app\src\db.inc.php(26): PDO-&#62;__construct() #1 U:\Webpages\thecanadianhosting.co\app\src\db.inc.php(35): getDB() #2 U:\Webpages\thecanadianhosting.co\app\src\routes.php(14): require('U:\\Webpages\\the...') #3 U:\Webpages\thecanadianhosting.co\app\public_html\index.php(27): require('U:\\Webpages\\the...') #4 {main} thrown in U:\Webpages\thecanadianhosting.co\app\src\db.inc.php on line 26 Solution Enable&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/uncaught-pdoexception-find-driver/">Uncaught PDOException: could not find driver</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p><b>Fatal error</b>: Uncaught PDOException: could not find driver in U:\Webpages\thecanadianhosting.co\app\src\db.inc.php:26<br />
Stack trace:<br />
#0 U:\Webpages\thecanadianhosting.co\app\src\db.inc.php(26): PDO-&gt;__construct()<br />
#1 U:\Webpages\thecanadianhosting.co\app\src\db.inc.php(35): getDB()<br />
#2 U:\Webpages\thecanadianhosting.co\app\src\routes.php(14): require('U:\\Webpages\\the...')<br />
#3 U:\Webpages\thecanadianhosting.co\app\public_html\index.php(27): require('U:\\Webpages\\the...')<br />
#4 {main}<br />
thrown in <b>U:\Webpages\thecanadianhosting.co\app\src\db.inc.php</b> on line <b>26</b></p>
<h2>Solution</h2>
<p>Enable this line in php.ini</p>
<p>extension=pdo_mysql</p>
<p>Then restart your app</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/uncaught-pdoexception-find-driver/">Uncaught PDOException: could not find driver</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/php/uncaught-pdoexception-find-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpoffice/phpspreadsheet 1.16.0 requires ext-zip * -&gt; it is missing from your system. Install or enable PHP&#039;s zip extension.</title>
		<link>https://tech.yipp.ca/php/phpofficephpspreadsheet-1-16-0-requires-ext-zip-missing-system-install-enable-phps-zip-extension/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=phpofficephpspreadsheet-1-16-0-requires-ext-zip-missing-system-install-enable-phps-zip-extension</link>
		<comments>https://tech.yipp.ca/php/phpofficephpspreadsheet-1-16-0-requires-ext-zip-missing-system-install-enable-phps-zip-extension/#comments</comments>
		<pubDate>Wed, 17 Feb 2021 03:21:08 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=3834</guid>
		<description><![CDATA[<p>Problem 1 - Root composer.json requires phpoffice/phpspreadsheet ^1.16 -&#62; satisfiable by phpoffice/phpspreadsheet[1.16.0]. - phpoffice/phpspreadsheet 1.16.0 requires ext-zip * -&#62; it is missing from your system. Install or enable PHP's zip extension. Solution This solution&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/phpofficephpspreadsheet-1-16-0-requires-ext-zip-missing-system-install-enable-phps-zip-extension/">phpoffice/phpspreadsheet 1.16.0 requires ext-zip * -> it is missing from your system. Install or enable PHP's zip extension.</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Problem 1<br />
- Root composer.json requires phpoffice/phpspreadsheet ^1.16 -&gt; satisfiable by phpoffice/phpspreadsheet[1.16.0].<br />
- phpoffice/phpspreadsheet 1.16.0 requires ext-zip * -&gt; it is missing from your system. Install or enable PHP's zip extension.</p>
<h2>Solution</h2>
<p>This solution assumes you are building from source PHP. If not, just install the extension php7.3-zip with apt-get.</p>
<p><span style="text-decoration: underline;">Step 1</span> - Install libraries before configuring PHP</p>
<p><strong>$ apt-get install libzip-dev</strong></p>
<p>Step 2 - Edit install_php.sh to have <strong>--with-zip</strong> in it next to the other configure options</p>
<p><span style="text-decoration: underline;">Step 2</span> - Reconfigure &amp; compile PHP from source</p>
<p><strong>$ ./install_php.sh 7.4.12</strong></p>
<h2>Troubleshooting</h2>
<p>configure: error: Package requirements (libzip &gt;= 0.11 libzip != 1.3.1 libzip != 1.7.0) were not met:</p>
<p>No package 'libzip' found<br />
No package 'libzip' found<br />
No package 'libzip' found</p>
<p>You likely did not run Step 1 before configuring &amp; building PHP.</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/phpofficephpspreadsheet-1-16-0-requires-ext-zip-missing-system-install-enable-phps-zip-extension/">phpoffice/phpspreadsheet 1.16.0 requires ext-zip * -> it is missing from your system. Install or enable PHP's zip extension.</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/php/phpofficephpspreadsheet-1-16-0-requires-ext-zip-missing-system-install-enable-phps-zip-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>configure: error: Cannot find php-config. Please use --with-php-config=PATH</title>
		<link>https://tech.yipp.ca/php/configure-error-find-php-config-please-use-php-configpath/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=configure-error-find-php-config-please-use-php-configpath</link>
		<comments>https://tech.yipp.ca/php/configure-error-find-php-config-please-use-php-configpath/#comments</comments>
		<pubDate>Wed, 17 Feb 2021 01:12:59 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=3820</guid>
		<description><![CDATA[<p>$./configure --with-php-config=/usr/local/php-7.4.12/bin/ checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for a sed that does not truncate output... /usr/bin/sed checking for pkg-config... /usr/bin/pkg-config checking pkg-config is&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/configure-error-find-php-config-please-use-php-configpath/">configure: error: Cannot find php-config. Please use --with-php-config=PATH</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>$./configure --with-php-config=/usr/local/php-7.4.12/bin/</p>
<p>checking for grep that handles long lines and -e... /usr/bin/grep<br />
checking for egrep... /usr/bin/grep -E<br />
checking for a sed that does not truncate output... /usr/bin/sed<br />
checking for pkg-config... /usr/bin/pkg-config<br />
checking pkg-config is at least version 0.9.0... yes<br />
checking for cc... cc<br />
checking whether the C compiler works... yes<br />
checking for C compiler default output file name... a.out<br />
checking for suffix of executables...<br />
checking whether we are cross compiling... no<br />
checking for suffix of object files... o<br />
checking whether we are using the GNU C compiler... yes<br />
checking whether cc accepts -g... yes<br />
checking for cc option to accept ISO C89... none needed<br />
checking how to run the C preprocessor... cc -E<br />
checking for icc... no<br />
checking for suncc... no<br />
checking for system library directory... lib<br />
checking if compiler supports -R... no<br />
checking if compiler supports -Wl,-rpath,... yes<br />
checking build system type... x86_64-pc-linux-gnu<br />
checking host system type... x86_64-pc-linux-gnu<br />
checking target system type... x86_64-pc-linux-gnu<br />
configure: error: Cannot find php-config. Please use --with-php-config=PATH</p>
<h2>Unsolvable !</h2>
<p>If you notice above,  I have already passed the --with-php-config path with the correct path, and the configure found php-config:</p>
<p><em>checking for pkg-config... /usr/bin/pkg-config</em><br />
<em>checking pkg-config is at least version 0.9.0... yes</em></p>
<p>What more can I do ?</p>
<p>In the configure.log I see</p>
<p><em>configure:3774: error: Cannot find php-config. Please use --with-php-config=PATH</em></p>
<p>Let's go see around line 3774:</p>
<table>
<tbody>
<tr>
<td># Check whether --with-php-config was given.<br />
if test "${with_php_config+set}" = set; then :<br />
echo "PATH SET"<br />
withval=$with_php_config; PHP_PHP_CONFIG=$withval<br />
else<br />
echo "PATH NOT SET"<br />
PHP_PHP_CONFIG=php-configfi</p>
<p>ext_output=$PHP_PHP_CONFIG</td>
</tr>
</tbody>
</table>
<p>So it runs directly the argument passed. They don't want the path (directory) where php-config is located, they want to fullpath of the binary !</p>
<h2>Solution</h2>
<p>./configure --with-php-config=/usr/local/php-7.4.12/bin/php-config</p>
<p>(...)</p>
<p>checking for gawk... gawk<br />
checking for fileinfo support... yes, shared<br />
checking for magic files in default path... not found<br />
configure: error: Please reinstall the libmagic distribution</p>
<p>Damn! It fails again for another reason!</p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/configure-error-find-php-config-please-use-php-configpath/">configure: error: Cannot find php-config. Please use --with-php-config=PATH</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/php/configure-error-find-php-config-please-use-php-configpath/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP7 &#039;phpunit&#039; is not recognized as an internal or external command,</title>
		<link>https://tech.yipp.ca/php/phpunit-recognized-internal-external-command/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=phpunit-recognized-internal-external-command</link>
		<comments>https://tech.yipp.ca/php/phpunit-recognized-internal-external-command/#comments</comments>
		<pubDate>Fri, 10 Jul 2020 20:19:04 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=3635</guid>
		<description><![CDATA[<p>U:\Webpages\thecanadianhosting.co\app&#62;composer test &#62; phpunit 'phpunit' is not recognized as an internal or external command, operable program or batch file. Script phpunit handling the test event returned with error code 1 Solution for PHP7 with&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/phpunit-recognized-internal-external-command/">PHP7 'phpunit' is not recognized as an internal or external command,</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>U:\Webpages\thecanadianhosting.co\app&gt;composer test<br />
&gt; phpunit<br />
'phpunit' is not recognized as an internal or external command,<br />
operable program or batch file.<br />
Script phpunit handling the test event returned with error code 1</p>
<h2>Solution for PHP7 with Composer</h2>
<pre>composer require --dev phpunit/phpunit ^7</pre>
<h2>Solution for PHP7 without Composer</h2>
<p>Downloads <a href="https://phar.phpunit.de/phpunit-7.phar" target="_blank">https://phar.phpunit.de/phpunit-7.phar<br />
</a></p>
<p>Save as "phpunit"</p>
<p>Run as ./phpunit</p>
<h2>Hard solution</h2>
<p>If the above don't work and you have recently upgraded from PHP5 to PHP7, the best solution in my opinion is to delete your composer.lock file, update your composer.json to have phpunit 7, then run composer install again for a fresh vendor install to the latest.</p>
<h2>More problems after upgrade</h2>
<p>U:\app&gt;composer test<br />
&gt; phpunit</p>
<p>Fatal error: Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in U:\app\tests\Functional\BaseTestCase.php on line 16</p>
<p>Error: Class 'PHPUnit_Framework_TestCase' not found in U:\app\tests\Functional\BaseTestCase.php on line 16</p>
<h3>Solution</h3>
<p>After updating phpunit to <strong>version 6 or greater</strong> released on 2017-02-03 you will need to rename <code>\PHPUnit_Framework_TestCase</code> to <code>\PHPUnit\Framework\TestCase</code></p>
<h2>Possible error: Undefined index: HTTP_HOST</h2>
<p>There were 6 errors:</p>
<p>1) Tests\Functional\CreateAccountTest::testLoginView<br />
Script phpunit handling the test event returned with error code 2<br />
Undefined index: HTTP_HOST</p>
<p>(...)</p>
<h3>Solution</h3>
<p>Add php server name in phpunit.xml like so :</p>
<div>
<div>&lt;phpunit bootstrap="vendor/autoload.php"&gt;</div>
<div><strong>    &lt;php&gt;</strong></div>
<div><strong>        &lt;server name='HTTP_HOST' value='http://localhost' /&gt;</strong></div>
<div><strong>    &lt;/php&gt;</strong></div>
<div>    &lt;testsuites&gt;</div>
<div>        &lt;testsuite name="SlimSkeleton"&gt;</div>
<div>            &lt;directory&gt;tests&lt;/directory&gt;</div>
<div>        &lt;/testsuite&gt;</div>
<div>    &lt;/testsuites&gt;</div>
<div>&lt;/phpunit&gt;</div>
</div>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/phpunit-recognized-internal-external-command/">PHP7 'phpunit' is not recognized as an internal or external command,</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/php/phpunit-recognized-internal-external-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>composer install error [ErrorException] &quot;continue&quot; targeting switch is equivalent to &quot;break&quot;. Did you mean to use &quot;continue 2&quot;?</title>
		<link>https://tech.yipp.ca/php/composer-install-error-errorexception-continue-targeting-switch-equivalent-break-mean-use-continue-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=composer-install-error-errorexception-continue-targeting-switch-equivalent-break-mean-use-continue-2</link>
		<comments>https://tech.yipp.ca/php/composer-install-error-errorexception-continue-targeting-switch-equivalent-break-mean-use-continue-2/#comments</comments>
		<pubDate>Fri, 10 Jul 2020 18:56:18 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=3627</guid>
		<description><![CDATA[<p>U:\app&#62;composer install Loading composer repositories with package information Installing dependencies (including require-dev) from lock file [ErrorException] "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? install [--prefer-source] [--prefer-dist] [--dry-run]&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/composer-install-error-errorexception-continue-targeting-switch-equivalent-break-mean-use-continue-2/">composer install error [ErrorException] "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>U:\app&gt;composer install<br />
Loading composer repositories with package information<br />
Installing dependencies (including require-dev) from lock file</p>
<p>[ErrorException]<br />
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?<br />
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [&lt;packages&gt;]...</p>
<h2>Why ?</h2>
<p>This seems to happen after upgrading PHP from 5.X to 7.X</p>
<h2>Troubleshooting</h2>
<p>U:\app&gt;composer diagnose<br />
Checking composer.json: OK<br />
Checking platform settings: OK<br />
Checking git settings: OK<br />
Checking http connectivity to packagist: OK<br />
Checking https connectivity to packagist: OK<br />
Checking github.com rate limit: OK<br />
Checking disk free space: OK<br />
Checking pubkeys:<br />
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB723 4E5D42D0 84A14642<br />
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E328C AD90147D AFE50952<br />
OK<br />
Checking composer version: WARNING<br />
You are not running the latest stable version, run `composer self-update` to update (1.4.1 =&gt; 1.10.8)</p>
<h3>`composer self-update` fails with</h3>
<p>U:\app&gt;composer self-update<br />
Updating to version 1.10.8 (stable channel).<br />
Downloading (100%)</p>
<p>[RuntimeException]<br />
SHA384 is not supported by your openssl extension, could not verify the phar file integrity</p>
<p>self-update [-r|--rollback] [--clean-backups] [--no-progress] [--update-keys] [--stable] [--preview] [--snapshot] [--set-channel-only] [--] [&lt;version&gt;]</p>
<h2>Solution</h2>
<p>The solution is to update composer. If on windows, uninstall it first with the uninstaller if any.</p>
<p><em>- Windows -</em></p>
<p>Add  &amp; Remove Program &gt; Uninstaller composer.</p>
<p>Re-install latest composer</p>
<p><a href="https://getcomposer.org/Composer-Setup.exe" target="_blank">https://getcomposer.org/Composer-Setup.exe</a></p>
<p><em>- Linux - </em></p>
<pre class="installer">php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e5325b19b381bfd88ce90a5ddb7823406b2a38cff6bb704b0acc289a09c8128d4a8ce2bbafcd1fcbdc38666422fe2806') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
</pre>
<h2>Success at last !</h2>
<p>U:\app&gt;composer install<br />
Loading composer repositories with package information<br />
Installing dependencies (including require-dev) from lock file<br />
Nothing to install or update<br />
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.<br />
Generating autoload files</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/php/composer-install-error-errorexception-continue-targeting-switch-equivalent-break-mean-use-continue-2/">composer install error [ErrorException] "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/php/composer-install-error-errorexception-continue-targeting-switch-equivalent-break-mean-use-continue-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
