<?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; Tjitjing Blog</title>
	<atom:link href="http://localhost/index.php/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.tjitjing.com/</link>
	<description>This is my blog on technology related stuff and on occation other things too...</description>
	<lastBuildDate>Tue, 24 Jun 2014 19:00:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.16</generator>
	<item>
		<title>Solution: Bootstrap glyphicons-halflings-regular.woff 404 not found</title>
		<link>https://blog.tjitjing.com/index.php/2014/06/solution-bootstrap-glyphicons-halflings-regular-woff-404-not-found.html</link>
					<comments>https://blog.tjitjing.com/index.php/2014/06/solution-bootstrap-glyphicons-halflings-regular-woff-404-not-found.html#comments</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Tue, 24 Jun 2014 19:00:44 +0000</pubDate>
				<category><![CDATA[IIS (Internet Information Server)]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Server Admin]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[Bootstrap]]></category>
		<category><![CDATA[Glyphicons]]></category>
		<category><![CDATA[IIS7]]></category>
		<category><![CDATA[Windows Server 2008]]></category>
		<guid isPermaLink="false">http://blog.tjitjing.com/?p=668</guid>

					<description><![CDATA[I&#8217;m testing out Bootstrap 3.1.1 by redoing the design of a very old site of mine, running on Php 5.3 on a Windows 2008/IIS 7 server. The new version of the site has been slow at loading the icons (wich are a Glyphicons web font) for buttons and when I check the Javascript console in Chrome&#8230; <a class="more-link" href="https://blog.tjitjing.com/index.php/2014/06/solution-bootstrap-glyphicons-halflings-regular-woff-404-not-found.html">Continue reading <span class="screen-reader-text">Solution: Bootstrap glyphicons-halflings-regular.woff 404 not found</span></a>]]></description>
										<content:encoded><![CDATA[<p>I&#8217;m testing out <a href="http://getbootstrap.com/" target="_blank" rel="noopener noreferrer">Bootstrap 3.1.1</a> by redoing the design of a <a title="GoSeller Gratis CRM" href="http://www.goseller.com/" target="_blank" rel="noopener noreferrer">very old site of mine</a>, running on Php 5.3 on a Windows 2008/IIS 7 server.</p>
<p>The new version of the site has been slow at loading the icons (wich are a <a href="http://glyphicons.com/" target="_blank" rel="noopener noreferrer">Glyphicons</a> web font) for buttons and when I check the Javascript console in Chrome (Ctrl+Shift+J) it shows the following error:</p>
<p>[code]GET /fonts/glyphicons-halflings-regular.woff 404 (Not Found)[/code]</p>
<p>After much testing and Googling it turns out my old IIS server does not have Mime types registered for .woff files.</p>
<p>So I go in to the IIS console, click MIME Types icon and add .woff as application/octet-stream &#8211; problem solved!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.tjitjing.com/index.php/2014/06/solution-bootstrap-glyphicons-halflings-regular-woff-404-not-found.html/feed</wfw:commentRss>
			<slash:comments>18</slash:comments>
		
		
			</item>
		<item>
		<title>Split text into multiple columns in PHP</title>
		<link>https://blog.tjitjing.com/index.php/2011/01/split-text-into-multiple-columns-in-php.html</link>
					<comments>https://blog.tjitjing.com/index.php/2011/01/split-text-into-multiple-columns-in-php.html#comments</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Wed, 26 Jan 2011 12:49:04 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Code snippet]]></category>
		<category><![CDATA[Example]]></category>
		<guid isPermaLink="false">http://blog.tjitjing.com/?p=354</guid>

					<description><![CDATA[I made a Swedish shopping directory using affiliate links for a site and wanted to split it into two columns. I wrote the following php function that can be used to split a string in two or more pieces. One parameter is at what character or string you want to split. For example if you&#8230; <a class="more-link" href="https://blog.tjitjing.com/index.php/2011/01/split-text-into-multiple-columns-in-php.html">Continue reading <span class="screen-reader-text">Split text into multiple columns in PHP</span></a>]]></description>
										<content:encoded><![CDATA[<p>I made a <a target="_blank" href="http://www.smskungen.se/shopping-guide.php" rel="noopener noreferrer">Swedish shopping directory</a> using affiliate links for a site and wanted to split it into two columns.</p>
<p><strong>I wrote the following php function that can be used to split a string in two or more pieces. </strong>One parameter is at what character or string you want to split. For example if you want to split at a space to not break up words, or split at a period to not split up sentences, at certain html tags such as &lt;h1&gt; to keep headlines and text in same column etc.</p>
<p>The function returns a string array with columns. </p>
<p>Example how to use:<br />
[code lang=&#8221;php&#8221;]<br />
	$TextString = &quot;some text to split&quot;)<br />
	$Columns = SplitIntoColumns ($TextString, 2, &quot;&lt;h1&gt;&quot;);<br />
	echo ($Columns[0]);<br />
	echo ($Columns[1]);<br />
[/code]</p>
<p>Function<br />
[code lang=&#8221;php&#8221;]<br />
function SplitIntoColumns ($InputString, $Columns, $SplitString) {</p>
<p>	// Source: http://blog.tjitjing.com/<br />
	//<br />
	// Splits a string into x number of columns and returns result as an array of columns<br />
	//<br />
	// Parameters:<br />
	// $InputString	String to be split into columns<br />
	// $Columns		Number of columns<br />
	// $SplitString	String to look for to not split midtext etc<br />
	//<br />
	// Change history:<br />
	// 2011-01-25/Max	Version 1<br />
	//</p>
<p>	// Find middle of text<br />
	$ColLength = strlen($InputString)/$Columns;</p>
<p>	// Split into columns<br />
	for($ColCount = 1; $ColCount &lt;= $Columns; $ColCount++) {</p>
<p>		// Find $SplitString, position to cut<br />
		$Pos = strpos($InputString , $SplitString , $LastPos + $ColLength);<br />
		if ($Pos === false) {<br />
			$Pos = strlen($InputString);<br />
		}</p>
<p>		// Cut out column<br />
		$Output[$ColCount &#8211; 1] = substr($InputString, $LastPos, $Pos &#8211; $LastPos);</p>
<p>		$LastPos = $Pos;</p>
<p>	}</p>
<p>	return $Output;</p>
<p> }<br />
[/code]</p>
<p><em>[Edit: VB.NET version: <a target="_blank" href="http://blog.tjitjing.com/index.php/2011/02/split-text-in-two-columns-in-vb-net.html" rel="noopener noreferrer">Split text in two columns in VB.NET</a>]</em></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.tjitjing.com/index.php/2011/01/split-text-into-multiple-columns-in-php.html/feed</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Install cURL PHP Extension on Windows IIS</title>
		<link>https://blog.tjitjing.com/index.php/2010/06/install-curl-php-extension-on-windows-iis.html</link>
					<comments>https://blog.tjitjing.com/index.php/2010/06/install-curl-php-extension-on-windows-iis.html#comments</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Mon, 07 Jun 2010 13:46:05 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows Server 2008]]></category>
		<category><![CDATA[IIS7]]></category>
		<guid isPermaLink="false">http://blog.tjitjing.com/?p=245</guid>

					<description><![CDATA[I tried to run a new PHP script that someone else wrote for me on my Windows Server 2008 and got some errors relating to cURL such as this: Fatal error: Call to undefined function curl_multi_init() First I spent a lot of time trying to find information on how to install cURL on a Windows&#8230; <a class="more-link" href="https://blog.tjitjing.com/index.php/2010/06/install-curl-php-extension-on-windows-iis.html">Continue reading <span class="screen-reader-text">Install cURL PHP Extension on Windows IIS</span></a>]]></description>
										<content:encoded><![CDATA[<p>I tried to run a new PHP script that someone else wrote for me on my Windows Server 2008 and got some errors relating to cURL such as this:</p>
<blockquote><p>Fatal error: Call to undefined function curl_multi_init() </p></blockquote>
<p>First I spent a lot of time trying to find information on how to install cURL on a Windows IIS installation, downloaded the cURL package, moved around files, copied to c:\windows\system32, updated php.ini and did all sorts of things described in forums, blogs and manuals but could not get it to work. </p>
<p><strong>Finally I decided to upgrade my PHP from 5.3.1 to the latest 5.3.2 release. I <a target="_blank" href="http://windows.php.net/download/" rel="noopener noreferrer">downloaded the PHP Windows MSI installer</a> and there in the Setup Wizard you can simply select what extensions you want to install. Selected cURL and it worked like a charm <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> I guess it was just to easy&#8230;<br />
</strong></p>
<p>(I post about this not only to let everyone know how stupid I am but since I could not find this info anywhere it could be good to document it)</p>
<p>I also tried running the installer again in &#8220;Change&#8221; mode to add and remove Extensions and the installer seems to be doing a pretty good job at adding and removing files + updating php.ini the way you would expect it to. </p>
<p>At one point I tried installing all Extensions but that got me in to trouble giving me a &#8220;oci.dll not found&#8221; trying to load an Oracle dll. My tip here is to install only the extensions you need or at least not any related to databases you do not use.</p>
<p>After clicking &#8220;Next&#8221; when you have selected what Extensions to install, the setup wizard may tell you files are locked and you have to restart the server after installing. A way to avoid this can be to (before clicking &#8220;Next&#8221;) stop the World Wide Web Publishing Service (from command line: NET STOP W3SVC). Just remember to start it again after!</p>
<p>Extensions available from install package in 5.3.2<br />
bzip2<br />
Curl<br />
Enchant<br />
EXIF<br />
Fileinfo<br />
GD2<br />
Gettext<br />
GMP<br />
IMAP<br />
Internationalization (intl)<br />
LDAP<br />
Multi-Byte String<br />
MySQL<br />
MySQLi<br />
OpenSSL<br />
Oracle (10)<br />
Oracle (11g)<br />
PDO<br />
PostgreSQL<br />
Shared Memory<br />
SNMP<br />
SOAP<br />
Sockets<br />
SQLite<br />
SQLite 3<br />
Tidy<br />
XML-RPC<br />
XSL</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.tjitjing.com/index.php/2010/06/install-curl-php-extension-on-windows-iis.html/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>PHP 5.3.1 upgrade on IIS7 and MySQL gives Internal Server Error</title>
		<link>https://blog.tjitjing.com/index.php/2010/02/php-5-3-1-upgrade-on-iis7-and-mysqlgives-internal-server-error.html</link>
					<comments>https://blog.tjitjing.com/index.php/2010/02/php-5-3-1-upgrade-on-iis7-and-mysqlgives-internal-server-error.html#comments</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Wed, 24 Feb 2010 14:36:20 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[IIS7]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Windows Server]]></category>
		<guid isPermaLink="false">http://blog.tjitjing.com/?p=225</guid>

					<description><![CDATA[Solution After a lot of googling and testing I finally found Bruce Kirkpatrick&#8217;s comment at the end of the PHP install manual Seems it is no longer enough to have localhost in the servers local hosts file (C:\Windows\System32\drivers\etc\hosts) you also have to comment out or remove the IPv6 equivalent. 127.0.0.1 localhost #::1 localhost After I&#8230; <a class="more-link" href="https://blog.tjitjing.com/index.php/2010/02/php-5-3-1-upgrade-on-iis7-and-mysqlgives-internal-server-error.html">Continue reading <span class="screen-reader-text">PHP 5.3.1 upgrade on IIS7 and MySQL gives Internal Server Error</span></a>]]></description>
										<content:encoded><![CDATA[<h2>Solution</h2>
<p>After a lot of googling and testing I finally found <a href="http://www.php.net/manual/en/install.windows.iis7.php">Bruce Kirkpatrick&#8217;s comment at the end of the PHP install manual</a></p>
<p><strong>Seems it is no longer enough to have localhost in the servers local hosts file (C:\Windows\System32\drivers\etc\hosts) you also have to comment out or remove the IPv6 equivalent.</strong></p>
<blockquote><p><code>127.0.0.1       localhost<br />
#::1             localhost</code></p></blockquote>
<p>After I did this everything worked ok again. Thanks Bruce!</p>
<h2>Problem</h2>
<p>I just upgraded PHP on my Windows Server 2008 running IIS7 from PHP 5.2.10 to 5.3.1. Used the non-threaded install package and installed for FastCGI.</p>
<p>After the upgrade installation worked fine for some non-database driven pages and phpinfo worked fine but whenever a page tries to accessed the MySQL database the browser only gave me a 500 Internal Server Error.</p>
<p>Checking the php error log (C:\Windows\Temp\php-errors.log) I get messages like this:</p>
<blockquote><p><code>[24-Feb-2010 13:44:36] PHP Warning:  mysql_connect() [&lt;a href='function.mysql-connect'&gt;function.mysql-connect&lt;/a&gt;]: [2002] A connection attempt failed because the connected party did not  (trying to connect via tcp://localhost:3306) in C:\inetpub\wwwroot\XXX\init_page.inc on line 32<br />
[24-Feb-2010 13:44:36] PHP Warning:  mysql_connect() [&lt;a href='function.mysql-connect'&gt;function.mysql-connect&lt;/a&gt;]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.<br />
in C:\inetpub\wwwroot\XXX\init_page.inc on line 32<br />
[24-Feb-2010 13:44:36] PHP Fatal error:  Maximum execution time of 60 seconds exceeded in C:\inetpub\wwwroot\XXX\init_page.inc on line 32</code></p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.tjitjing.com/index.php/2010/02/php-5-3-1-upgrade-on-iis7-and-mysqlgives-internal-server-error.html/feed</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
