<?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>am3n portfolio &#187; php</title>
	<atom:link href="http://www.am3n.net/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.am3n.net</link>
	<description>career, freelance and some stupid thing I do</description>
	<lastBuildDate>Mon, 09 May 2011 16:27:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Magento error with pdo_mysql</title>
		<link>http://www.am3n.net/2009/12/27/magento-error-with-pdo_mysql/</link>
		<comments>http://www.am3n.net/2009/12/27/magento-error-with-pdo_mysql/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 17:06:58 +0000</pubDate>
		<dc:creator>am3n</dc:creator>
				<category><![CDATA[Freelance]]></category>
		<category><![CDATA[Web and System Administrator]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[pdo_mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://am3n.net/?p=216</guid>
		<description><![CDATA[Magento is a great Free / Open source eCommerce script, is much more prettier and yet complex than Prestashop or osCommerce or Virtuemart. Take sometimes to upload it to hosting server, but if your hosting provider have Automatic script installer like Installatron or Softacolous, you can install it in a breeze. So Installation of Magento [...]
Related posts:<ol>
<li><a href='http://www.am3n.net/2009/06/18/sql-error-table-mysqlproc-doesnt-exist/' rel='bookmark' title='SQL Error: Table &#8216;mysql.proc&#8217; doesn&#8217;t exist'>SQL Error: Table &#8216;mysql.proc&#8217; doesn&#8217;t exist</a> <small>Today I upgraded my HeidiSQL into version 4, but when...</small></li>
<li><a href='http://www.am3n.net/2009/02/09/skip-replication-error/' rel='bookmark' title='Skip Replication Error'>Skip Replication Error</a> <small>This is happen long time ago when Mysql Replication stop...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Magento is a great Free / Open source eCommerce script, is much more prettier and yet complex than Prestashop or osCommerce or Virtuemart. Take sometimes to upload it to hosting server, but if your hosting provider have Automatic script installer like Installatron or Softacolous, you can install it in a breeze. So Installation of Magento is no longer problem.</p>
<p>But after a succesful installation, I even get this error saying that I dont have pdo_mysql installed on the server.</p>
<pre>pdo_mysql extension is not installed
Trace:
#0 /home/store/public_html/lib/Zend/Db/Adapter/Abstract.php(441):
Varien_Db_Adapter_Pdo_Mysql-&gt;_connect()
#1 /home/store/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(230):
Zend_Db_Adapter_Abstract-&gt;query('SET NAMES utf8', Array)
#2 /home/store/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(281):
Zend_Db_Adapter_Pdo_Abstract-&gt;query('SET NAMES utf8', Array)
#3 /home/store/public_html/app/code/core/Mage/Core/Model/Resource/
Type/Db/Pdo/Mysql.php(45):
Varien_Db_Adapter_Pdo_Mysql-&gt;query('SET NAMES utf8')
#4 /home/store/public_html/app/code/core/Mage/Core/Model/
Resource.php(87): Mage_Core_Model_Resource_Type_Db_Pdo_Mysql-
&gt;getConnection(Object(Mage_Core_Model_Config_Element))
#5 /home/store/public_html/app/code/core/Mage/Core/Model/Resource/
Setup.php(62): Mage_Core_Model_Resource-&gt;getConnection('core_setup')
#6 /home/store/public_html/app/code/core/Mage/Core/Model/Resource/
Setup.php(120): Mage_Core_Model_Resource_Setup-&gt;__construct('core_setup')
#7 /home/store/public_html/app/code/core/Mage/Core/Model/Config.php(263):
Mage_Core_Model_Resource_Setup::applyAllUpdates()
#8 /home/store/public_html/app/code/core/Mage/Core/Model/App.php(263):
Mage_Core_Model_Config-&gt;init(Array)
#9 /home/store/public_html/app/Mage.php(434):
Mage_Core_Model_App-&gt;init('', 'store', Array)
#10 /home/store/public_html/app/Mage.php(455):
Mage::app('', 'store', Array)
#11 /home/store/public_html/index.php(65): Mage::run()
#12 {main}</pre>
<p>I don&#8217;t get it, when I check with function</p>
<pre>&lt;?php
phpinfo();
?&gt;</pre>
<p>pdo and pdo_mysql is there.</p>
<pre>'--enable-pdo=shared'
'--with-pdo-mysql=shared'</pre>
<p>So, it&#8217;s time for searching and lurking into Google and Magento forum/docs<br />
<span id="more-216"></span><br />
Almost an hour, until I found this <a href="http://www.magentocommerce.com/boards/viewthread/16158/" target="_blank">thread</a>, it says I need to add these lines into php.ini. I have root access to server so it does not problem for me, but about other who just using shared hosting?</p>
<pre>; added when pdo_mysql is shared (or missing)
extension=pdo.so
extension=pdo_mysql.so
extension=pdo_sqlite.so</pre>
<p>Turns out, it&#8217;s not necessary system php.ini, I was misunderstand, and when I look on magento install dir, I found php.ini file, edit the file with above line. Open Magento URL, and there you go, Magento installation running succesfully. <img src='http://am3n.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<script type="text/javascript" src="http://cdn.socialtwist.com/2009042316105/script.js"></script><a class="st-taf" href="http://tellafriend.socialtwist.com:80" onclick="return false;" style="border:0;padding:0;margin:0;"><img alt="SocialTwist Tell-a-Friend" style="border:0;padding:0;margin:0;" src="http://images.socialtwist.com/2009042316105/button.png"onmouseout="STTAFFUNC.hideHoverMap(this)" onmouseover="STTAFFUNC.showHoverMap(this, '2009042316105', 'http%3A%2F%2Fwww.am3n.net%2F2009%2F12%2F27%2Fmagento-error-with-pdo_mysql%2F', 'Magento+error+with+pdo_mysql')" onclick="STTAFFUNC.cw(this, {id:'2009042316105', link: 'http%3A%2F%2Fwww.am3n.net%2F2009%2F12%2F27%2Fmagento-error-with-pdo_mysql%2F', title: 'Magento+error+with+pdo_mysql' });"/></a><p>Related posts:<ol>
<li><a href='http://www.am3n.net/2009/06/18/sql-error-table-mysqlproc-doesnt-exist/' rel='bookmark' title='SQL Error: Table &#8216;mysql.proc&#8217; doesn&#8217;t exist'>SQL Error: Table &#8216;mysql.proc&#8217; doesn&#8217;t exist</a> <small>Today I upgraded my HeidiSQL into version 4, but when...</small></li>
<li><a href='http://www.am3n.net/2009/02/09/skip-replication-error/' rel='bookmark' title='Skip Replication Error'>Skip Replication Error</a> <small>This is happen long time ago when Mysql Replication stop...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.am3n.net/2009/12/27/magento-error-with-pdo_mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP with SuPHP on cPanel</title>
		<link>http://www.am3n.net/2009/06/27/php-with-suphp-on-cpanel/</link>
		<comments>http://www.am3n.net/2009/06/27/php-with-suphp-on-cpanel/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 15:32:35 +0000</pubDate>
		<dc:creator>am3n</dc:creator>
				<category><![CDATA[Freelance]]></category>
		<category><![CDATA[Web and System Administrator]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[suphp]]></category>

		<guid isPermaLink="false">http://am3n.net/?p=153</guid>
		<description><![CDATA[When you activated SuPHP on cPanel servers, this is the normal output should be. The MIME types associated with PHP may have changed. If you experience problems with PHP related settings in .htaccess files, ensure those files use the MIME types specified above (the first value listed after AddType.) php.conf updated to: # This file [...]
Related posts:<ol>
<li><a href='http://www.am3n.net/2009/06/06/disk-space-usage-on-cpanel-shows-incorrect-size/' rel='bookmark' title='Disk Space Usage on cPanel shows incorrect size'>Disk Space Usage on cPanel shows incorrect size</a> <small>After you delete some big files on your cpanel hosting...</small></li>
<li><a href='http://www.am3n.net/2009/02/09/hdd-partition-for-cpanel-server/' rel='bookmark' title='hdd partition for cpanel server'>hdd partition for cpanel server</a> <small>Simple Harddisk partition, assume only for vps and have or...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>When you activated SuPHP on cPanel servers, this is the normal output should be. </p>
<blockquote><p>
The MIME types associated with PHP may have changed.<br />
If you experience problems with PHP related settings in .htaccess files, ensure<br />
those files use the MIME types specified above (the first value listed after AddType.) </p></blockquote>
<p><span id="more-153"></span></p>
<pre>
php.conf updated to:

# This file was automatically generated by the Cpanel PHP Configuration system
# If you wish to change the way PHP is being handled by Apache on your system,
# use the /usr/local/cpanel/bin/rebuild_phpconf script or the WHM interface.
#
# Manual edits of this file will be lost when Apache is updated.

# SuPHP configuration for PHP5
LoadModule suphp_module modules/mod_suphp.so
suPHP_Engine on
AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
<Directory />
    suPHP_AddHandler application/x-httpd-php5
</Directory>

# End of autogenerated PHP configuration.

Updating user configurable PHP settings.
[info] recursion depth is set to: 2
Restarting Apache
</pre>
<script type="text/javascript" src="http://cdn.socialtwist.com/2009042316105/script.js"></script><a class="st-taf" href="http://tellafriend.socialtwist.com:80" onclick="return false;" style="border:0;padding:0;margin:0;"><img alt="SocialTwist Tell-a-Friend" style="border:0;padding:0;margin:0;" src="http://images.socialtwist.com/2009042316105/button.png"onmouseout="STTAFFUNC.hideHoverMap(this)" onmouseover="STTAFFUNC.showHoverMap(this, '2009042316105', 'http%3A%2F%2Fwww.am3n.net%2F2009%2F06%2F27%2Fphp-with-suphp-on-cpanel%2F', 'PHP+with+SuPHP+on+cPanel')" onclick="STTAFFUNC.cw(this, {id:'2009042316105', link: 'http%3A%2F%2Fwww.am3n.net%2F2009%2F06%2F27%2Fphp-with-suphp-on-cpanel%2F', title: 'PHP+with+SuPHP+on+cPanel' });"/></a><p>Related posts:<ol>
<li><a href='http://www.am3n.net/2009/06/06/disk-space-usage-on-cpanel-shows-incorrect-size/' rel='bookmark' title='Disk Space Usage on cPanel shows incorrect size'>Disk Space Usage on cPanel shows incorrect size</a> <small>After you delete some big files on your cpanel hosting...</small></li>
<li><a href='http://www.am3n.net/2009/02/09/hdd-partition-for-cpanel-server/' rel='bookmark' title='hdd partition for cpanel server'>hdd partition for cpanel server</a> <small>Simple Harddisk partition, assume only for vps and have or...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.am3n.net/2009/06/27/php-with-suphp-on-cpanel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Nobody&#8221; prevented from sending emails</title>
		<link>http://www.am3n.net/2009/06/23/nobody-prevented-from-sending-emails/</link>
		<comments>http://www.am3n.net/2009/06/23/nobody-prevented-from-sending-emails/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 09:39:14 +0000</pubDate>
		<dc:creator>am3n</dc:creator>
				<category><![CDATA[Freelance]]></category>
		<category><![CDATA[Web and System Administrator]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[emails]]></category>
		<category><![CDATA[ini_set]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[nobody]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[prevent]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sending]]></category>

		<guid isPermaLink="false">http://am3n.net/?p=141</guid>
		<description><![CDATA[Forget what I said below, if your webhosting has disabled user &#8220;nobody&#8221; to sent email, then they should enable suphp. This way, all PHP script executes as user account and not nobody. And will deliver email correctly. ========== So your webhosting provider activated &#8220;Prevent &#8220;nobody&#8221; from sending mail&#8221; which cause your PHP script can&#8217;t sent [...]]]></description>
			<content:encoded><![CDATA[<p>Forget what I said below, if your webhosting has disabled user &#8220;nobody&#8221; to sent email, then they should enable suphp. This way, all PHP script executes as user account and not nobody. And will deliver email correctly.</p>
<p>==========</p>
<p>So your webhosting provider activated &#8220;Prevent &#8220;nobody&#8221; from sending mail&#8221; which cause your PHP script can&#8217;t sent email? You can use PHP classes called <a href="http://xpertmailer.com/" target="_blank">XpertMailer </a>or <a href="http://phpmailer.codeworxtech.com/" target="_blank">PHPMailer </a>but somehow it&#8217;s not working well on my host. Weird&#8230; The previous version XPertMailer works like charm but somehow the new one never sent my emails.</p>
<p>So I googling around and found <a href="http://www.webmasterworld.com/forum88/10109.htm" target="_blank">Webmaster World&#8217;s Forum</a>, and luckily the ini_set function is not disabled. So I test the script and it works flawlessly. Below is the script<br />
<span id="more-141"></span></p>
<pre>&lt;?PHP
/* Setup your To, Subject and Message Body */
$to='MyRealName &lt;me@mydomain.com&gt;';
$subject='Testing PHP Email';
$body='Put Your Text Message Here.';

/* Specify your SMTP Server, Port and Valid from Address */
ini_set("SMTP","mail.mydomain.com");
ini_set("smtp_port","25");
ini_set("sendmail_from","me@mydomain.com");

/* Additional Headers */
$headers = "from:MyRealName &lt;me@mydomain.com&gt;\r\n";
//$headers .= "Cc:RealCCName &lt;ccUser@theirdomain.com&gt;\r\n";
//$headers .= "Bcc:RealBCCName &lt;bccUser@theirdomain.com&gt;\r\n";

/* Try to send message and respond if it sends or fails. */
if(mail ($to, $subject, $body, $headers )){
echo "&lt;h2&gt;Your Message was sent!&lt;/h2&gt;";
}
else{
echo "&lt;font color='red'&gt;&lt;h2&gt;Your Message Was Not Sent!&lt;/h2&gt;&lt;/font&gt;";
}
exit;
?&gt;</pre>
<p>PS: email account me@mydomain.com should exist and password should be correct</p>
<p>Now what should I do if the disable function ini_set also?? Hmm&#8230;???</p>
<script type="text/javascript" src="http://cdn.socialtwist.com/2009042316105/script.js"></script><a class="st-taf" href="http://tellafriend.socialtwist.com:80" onclick="return false;" style="border:0;padding:0;margin:0;"><img alt="SocialTwist Tell-a-Friend" style="border:0;padding:0;margin:0;" src="http://images.socialtwist.com/2009042316105/button.png"onmouseout="STTAFFUNC.hideHoverMap(this)" onmouseover="STTAFFUNC.showHoverMap(this, '2009042316105', 'http%3A%2F%2Fwww.am3n.net%2F2009%2F06%2F23%2Fnobody-prevented-from-sending-emails%2F', '%26%238220%3BNobody%26%238221%3B+prevented+from+sending+emails')" onclick="STTAFFUNC.cw(this, {id:'2009042316105', link: 'http%3A%2F%2Fwww.am3n.net%2F2009%2F06%2F23%2Fnobody-prevented-from-sending-emails%2F', title: '%26%238220%3BNobody%26%238221%3B+prevented+from+sending+emails' });"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.am3n.net/2009/06/23/nobody-prevented-from-sending-emails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

