<?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>Mike Hillyer&#039;s Personal Webspace &#187; MySQL</title>
	<atom:link href="http://mikehillyer.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://mikehillyer.com</link>
	<description>Gentlemen! Look, and Behold!</description>
	<lastBuildDate>Wed, 21 Sep 2011 20:45:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Resolving PHP-MySQL Connection Issues</title>
		<link>http://mikehillyer.com/php/resolving-php-mysql-connection-issues/</link>
		<comments>http://mikehillyer.com/php/resolving-php-mysql-connection-issues/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 16:11:11 +0000</pubDate>
		<dc:creator>Mike Hillyer</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SELinux]]></category>

		<guid isPermaLink="false">http://mikehillyer.com/?p=19</guid>
		<description><![CDATA[I ran into an interesting issue when installing WordPress on my re-installed server, I could not get a database connection during installation. I added some debugging and discovered that I had a "Can't connect to MySQL server on" error returned after the call to mysql_connect() in PHP. To check the source of the issue I [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into an interesting issue when installing WordPress on my re-installed server, I could not get a database connection during installation. I added some debugging and discovered that I had a "Can't connect to MySQL server on" error returned after the call to mysql_connect() in PHP.</p>
<p>To check the source of the issue I then tried to connect on the command-line using the mysql client, which occurred successfully, confirming that I was using the correct credentials and host address (this was a remote MySQL server).</p>
<p>I next created a test PHP script with a simple mysql_connect() call, and executed it with "php test.php" from the command-line, which was also successful.</p>
<p>Finally I accessed test.php through a browser, where again the connection failed.</p>
<p>So I was dealing with a situation where it was Apache in particular that was unable to connect to the remote MySQL server. Thanks to <a title="Wez Furlong's Blog" href="http://netevil.org" target="_blank">Wez Furlong</a>'s ideas I was able to narrow this down to SELinux blocking outgoing communications by Apache.</p>
<p>So, if you're having issues with Apache and specifically connecting out, you may want to <a title="Disable SELinux for Apache" href="http://www.cyberciti.biz/faq/howto-disable-httpd-selinux-security-protection/" target="_blank">disable SELinux for Apache</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mikehillyer.com/php/resolving-php-mysql-connection-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

