<?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>Peeled Carrots &#187; php</title>
	<atom:link href="http://www.peeledcarrots.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.peeledcarrots.com</link>
	<description>....cause life&#039;s too short to peel carrots. Enough said!!</description>
	<lastBuildDate>Tue, 03 Nov 2009 14:42:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wamp php fopen and fsockopen problem on vista</title>
		<link>http://www.peeledcarrots.com/wamp-php-fopen-and-fsockopen-problem-on-vista/</link>
		<comments>http://www.peeledcarrots.com/wamp-php-fopen-and-fsockopen-problem-on-vista/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 18:46:15 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[wamp]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.peeledcarrots.com/?p=217</guid>
		<description><![CDATA[I have finally found a solution to a fopen/fsockopen problem I was having on Vista using Wampserver&#8230;I know it&#8217;s not ideal to be developing on Windoze, but it&#8217;s my work machine so don&#8217;t crucify me  
I wanted to access a php file on my localhost using the following code: 
$fp = fopen("http://localhost/test/export.php", "r");
but got [...]]]></description>
			<content:encoded><![CDATA[<p>I have finally found a solution to a <strong>fopen/fsockopen</strong> problem I was having on Vista using <strong><a href="http://www.wampserver.com/">Wampserver</a></strong>&#8230;I know it&#8217;s not ideal to be developing on Windoze, but it&#8217;s my work machine so don&#8217;t crucify me <img src='http://www.peeledcarrots.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I wanted to access a php file on my localhost using the following code: </p>
<p><code>$fp = fopen("http://localhost/test/export.php", "r");</code></p>
<p>but got a [function.fopen] php warning:</p>
<blockquote><p><strong>Warning</strong>: fopen(http://localhost/test/export.php) [function.fopen]: failed to open stream: 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. in C:\wamp\www\test\export.php on line 11</p></blockquote>
<p>I also tried adding &#8220;@&#8221; before the <strong>fopen</strong>, but still got the same php warnings</p>
<p><code>$fp = @fopen("http://localhost/test/export.php", "r");</code></p>
<p>So instead I tried <strong>fsockopen </strong>instead, but got another smiliar warning:</p>
<blockquote><p><strong>Warning</strong>: fsockopen() [function.fsockopen]: unable to connect to http://localhost/test/export.php (Unable to find the socket transport &#8220;http&#8221; &#8211; did you forget to enable it when you configured PHP?) in C:\wamp\www\test\export.php on line 11</p></blockquote>
<p><strong>Now for the solution:</strong></p>
<p>I came across a solution which worked for me on the <a href="http://www.wampserver.com/phorum/read.php?2,28291">wampserver forum</a>: </p>
<blockquote><p>I think I just found the solution here: <a href="http://bugs.php.net/bug.php?id=40287">bugs.php.net</a></p>
<p>It seems by changing &#8216;localhost&#8217; to &#8216;127.0.0.1&#8242; it works! </p></blockquote>
<p>So, changing the code to look like this actually works:</p>
<p><code>$fp = fopen("http://127.0.0.1/test/export.php", "r");</code></p>
<p>Strange, but true. Thanks to <a href="http://www.wampserver.com/phorum/profile.php?2,6192">anarchitecton</a>!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/wamp-php-fopen-and-fsockopen-problem-on-vista/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Smarty PHP Google Maps API plugin</title>
		<link>http://www.peeledcarrots.com/smarty-php-google-maps-api-plugin/</link>
		<comments>http://www.peeledcarrots.com/smarty-php-google-maps-api-plugin/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 11:30:05 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.peeledcarrots.com/?p=216</guid>
		<description><![CDATA[When I wrote my last post on PHP Smarty I was still wet behind the ears when it came to web development, but 3 years on and I have got a bit more experience and can offer a bit more insight to my fellow web ninjas out there&#8230;wachaaa, judo chop!!
I was recently building a web [...]]]></description>
			<content:encoded><![CDATA[<p>When I wrote my last post on <a href="http://www.peeledcarrots.com/2006/10/26/getting-to-grips-with-pear-quickform-and-smarty/ "><strong>PHP Smart</strong>y</a> I was still wet behind the ears when it came to web development, but 3 years on and I have got a bit more experience and can offer a bit more insight to my fellow web ninjas out there&#8230;wachaaa, judo chop!!</p>
<p>I was recently building a web application where I was using <a href="http://www.smarty.net/"><strong>Smarty</strong></a>, which is a really lightweight templating engine and I would definitely recommend using it instead of <a href="http://pear.php.net/package/HTML_Template_Flexy"><strong>Flexy</strong></a> (part of <strong>PEAR</strong>) as the documentation is almost ten times as good and it doesnâ€™t rely on a massive <a href="http://www.php.net">PHP </a> library like P<strong>EAR</strong>.</p>
<p>The <strong>Google Map API</strong> plugin for <strong>Smarty </strong>has been around for a few years now and the latest release is version 2.5 which was released in September 2007. </p>
<p>It is really easy to use and if you are familiar with the way Smarty works, then youâ€™ll be laughing!! There is some detailed documentation on <a href="http://www.phpinsider.com/php/code/GoogleMapAPI/">phpinsider.com</a>, so if you need any help then I would suggest this <a href="http://www.phpinsider.com/php/code/GoogleMapAPI/">page</a>.</p>
<p>All you need to get going is the following:</p>
<ol>
<li>Latest version of <strong>Smarty</strong>(obviously)</li>
<li>The <strong>Google Map API</strong> class <a href="http://www.phpinsider.com/php/code/GoogleMapAPI/GoogleMapAPI-2.5.tar.gz">plugin</a></li>
<li>A <strong>Google Map API</strong> key</li>
</ol>
<p>It is really configurable and is very easy to integrate into existing <strong>Smarty</strong> templates, so why not give it a try&#8230;here is a <a href="http://www.phpinsider.com/php/code/GoogleMapAPI/demo/">demo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/smarty-php-google-maps-api-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>G3 Global launches a new website and blog</title>
		<link>http://www.peeledcarrots.com/g3-global-launches-a-new-website-and-blog/</link>
		<comments>http://www.peeledcarrots.com/g3-global-launches-a-new-website-and-blog/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 10:15:58 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.peeledcarrots.com/?p=208</guid>
		<description><![CDATA[I am currently working for G3 Global a company specialising in SAP implementation in the media industry. Apart from building web portal applications for clients, I have also been working on improving the website. 
G3 Global is a SAP Channel Partner specialising in the implementation of SAP ERP solutions in the Media industry.
The old site [...]]]></description>
			<content:encoded><![CDATA[<p>I am currently working for <a href="http://www.g3it.com">G3 Global</a> a company specialising in SAP implementation in the media industry. Apart from building web portal applications for clients, I have also been working on improving the <a href="http://www.g3it.com">website</a>. </p>
<blockquote><p>G3 Global is a SAP Channel Partner specialising in the implementation of SAP ERP solutions in the Media industry.</p></blockquote>
<p>The old site was built using static php pages, had a dated design and was disjointed in a few areas. So, we set out to improve the site by putting more emphasis on our products, the introduction of a fresh design, a flatter hierarchy, a blog, and an events section.</p>
<p>The design was done by &#8220;<a href="http://www.caffeinehit.com/">Andy</a>, the chief coffee drinker&#8221; at <a href="http://www.caffeinehit.com/blog/2009/06/10/g3-global-website-re-design-goes-live/">Caffeinehit Ltd </a>. I have to say that he did a great job after lots of Starbucks Grande latte&#8217;s and a few design workshops in our offices.</p>
<p>I did the implementation of the site and for those of you that care&#8230;yes the geeks <img src='http://www.peeledcarrots.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> , I used <a href="http://wordpress.org/">wordpress</a> as the CMS solution along with a number of plugins which I either downloaded and hacked or wrote myself.</p>
<p>Overall I really enjoyed working on the site and I think it has been well received by the rest of the company. Now all we need to do is get everyone blogging&#8230;so I&#8217;m going to have to answer questions like &#8211; &#8220;what&#8217;s a blog?&#8221;, &#8220;how do i put a list into a post?&#8221;&#8230;blah, blah, blah <img src='http://www.peeledcarrots.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Besides Andy, thanks also go out to <a href="http://www.g3it.com/author/cgunter/">Chris</a> and <a href="http://drewpreston.wordpress.com/">Drew</a> for their hard work and guidance. Good effort lads!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/g3-global-launches-a-new-website-and-blog/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Reviewing a CMS solution developed on Mediatemple with the Seagull PHP Framework, including Paypal integration</title>
		<link>http://www.peeledcarrots.com/reviewing-a-cms-solution-developed-on-mediatemple-with-the-seagull-php-framework-including-paypal-integration/</link>
		<comments>http://www.peeledcarrots.com/reviewing-a-cms-solution-developed-on-mediatemple-with-the-seagull-php-framework-including-paypal-integration/#comments</comments>
		<pubDate>Wed, 25 Jul 2007 11:29:02 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Seagull]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.technovated.com/2007/07/25/reviewing-a-cms-solution-developed-on-mediatemple-with-the-seagull-php-framework-including-paypal-integration/</guid>
		<description><![CDATA[On Friday 20th July I finally deployed a site which we as a team have been working on for a number of months. Working on the project has been a huge learning curve and has taken way longer than ever expected.

The site which I am talking about is http://bd4d.com, which stands for By Designers 4 [...]]]></description>
			<content:encoded><![CDATA[<p>On Friday 20th July I finally deployed a site which we as a team have been working on for a number of months. Working on the project has been a huge learning curve and has taken way longer than ever expected.</p>
<p><a href="http://www.bd4d.com"><img src="http://www.technovated.com/wp-content/bd4d-home.jpg" width="550"  alt="BD4D"/></a></p>
<p>The site which I am talking about is <a href="http://www.bd4d.com">http://bd4d.com</a>, which stands for By Designers 4 Designers is built using the <a href="http://seagull.phpkitchen.com/">seagull php framework</a> with the new <a href="http://trac.seagullproject.org/wiki/Modules/Cms">cms</a> module</p>
<h3>General comments</h3>
<p>
<h4>Media Temple Installation</h4>
<p>During the live installation I encountered a few problems, most of which related to permissions of files on the server:</p>
<p>The main one however were the permissions of the /var/lib/php/session/ folder â€“ it has to be writable</p>
<p>
<h4>Plugins that I found really useful during development</h4>
<p>There were two firefox plug-ins that I found very useful during development of the site:</p>
<p><a href="http://www.iosart.com/firefox/colorzilla/">Colorzilla</a> â€“ gives you # codes for colours on any webpage<br />
<a href="https://addons.mozilla.org/en-US/firefox/addon/1419">IE tab </a>â€“ allows you to open up ie7 tabs within firefox, which is great for cross browser compliant xhtml/css</p>
<p>Thanks to the developers of these two add-ons <img src='http://www.peeledcarrots.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>
<h4>Paypal</h4>
<p>The site has a payment gateway for listing jobs and events which has transaction processing done by <a href="https://www.paypal.com/">Paypal</a>.</p>
<p>In terms of project mistakes, this was one of the biggest we made. The support that <a href="http://www.floydtech.co.uk">James</a> received from  <a href="https://www.paypal.com/">Paypal</a> was extremely poor and the general documentation which they supply is often out of date and incorrect. I am amazed that they have become such a successful company, when it is so difficult to integrate their transaction processing into oneâ€™s site.</p>
<p>However after a lot of waiting for accounts to go live, numerous queries, emails, phone calls and a lot of frustration, we did eventually get the transactions working. It is working fine now, but it was definitely not worth all of that hassle.</p>
<p>I would be interested to here about other experiences from developers using  <a href="https://www.paypal.com/">Paypal</a> â€“ hopefully you had a better one than we did.</p>
<h3>Site Features</h3>
<p>
<h4>Showcase</h4>
<p>The section of the site that I am most proud of is the <a href="http://www.bd4d.com/index.php/default/showcase/action/list/">Showcase</a> section, which has flash and movies of some really cool clips which the <a href="http://www.bd4d.com">bd4d</a> guys have done. The section allows comments to be made on each of the movies and I think it looks pretty slick â€“ even if I say so myself <img src='http://www.peeledcarrots.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>To get the section functioning, I used the following:</p>
<p>A comment manager which Dmitri initially developed and then  I adapted that code to be used for the site.</p>
<p>To prevent spam on the site I used <a href="http://pear.php.net/package/Text_CAPTCHA">captcha package</a> from the <a href="http://pear.php.net/">php pear library</a></p>
<p>And I used the following code in the template to hold the movies/flash files:</p>
<p><code>< object width="550" height="400" ><br />
< param name="movie" value="{webRoot}/themes/bd4d/showcasemovies/<br />
{oItem.media}" ><br />
< param name="quality" value="high" ><br />
< embed src="{webRoot}/themes/bd4d/showcasemovies/<br />
{oItem.media}" quality="high" width="{oItem.width}" height="{oItem.height}" autostart="true">< / embed ><br />
< / object >	</code></p>
<p>
<h4>Events</h4>
<p>The <a href="http://www.bd4d.com/index.php/event/calendar/action/viewMonth/y/2007/m/07/regionId/0/">Events calendar</a> uses the default seagull events module as a basis, but there where a few enhancements made to fit the requirements of the site. The majority of the development of this section was done by James and I think that he did a pretty good job of it.</p>
<p>The calendar looks pretty slick and works really well, also the backend of the seagull events module provides a lot of flexibility for administrators wanting to manage events.</p>
<p>
<h4>Job board</h4>
<p>The <a href="http://www.bd4d.com/index.php/default/jobboard/action/list/">Job board</a> uses custom managers in the default module and as I have mentioned in my section about paypal, it allows members of the site to post jobs for a fee. The transaction processing handles straight paypal payments as well as credit card payments which are verified by paypal.</p>
<p>
<h3>Conclusion</h3>
<p>As I mentioned in the introduction this site took way longer than expected and there were a number of hard lessons which the whole team learnt. But at the end of the day, the site looks pretty good and works as expected, so in some way it can be seen as a success.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/reviewing-a-cms-solution-developed-on-mediatemple-with-the-seagull-php-framework-including-paypal-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing a CMS solution on Mediatemple with the Seagull PHP Framework, including Google Maps</title>
		<link>http://www.peeledcarrots.com/developing-a-cms-solution-on-mediatemple-with-the-seagull-php-framework-including-google-maps/</link>
		<comments>http://www.peeledcarrots.com/developing-a-cms-solution-on-mediatemple-with-the-seagull-php-framework-including-google-maps/#comments</comments>
		<pubDate>Fri, 20 Apr 2007 09:03:53 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Seagull]]></category>

		<guid isPermaLink="false">http://www.technovated.com/2007/04/20/developing-a-cms-solution-on-mediatemple-with-the-seagull-php-framework-including-google-maps/</guid>
		<description><![CDATA[Having just completed the Atalink site, I would like to highlight some of my experiences, frustrations and lessons which I have learnt over the past few months. 
Background
I developed the site using the Seagull php framework, using the publisher module (which has recently been superseded by the CMS module). 
The publisher module requires a bit [...]]]></description>
			<content:encoded><![CDATA[<p>Having just completed the Atalink site, I would like to highlight some of my experiences, frustrations and lessons which I have learnt over the past few months. </p>
<p><strong>Background</strong></p>
<p>I developed the site using the Seagull php framework, using the <a href="http://trac.seagullproject.org/wiki/Modules/Publisher">publisher module </a>(which has recently been superseded by the <a href="http://trac.seagullproject.org/wiki/Modules/Cms">CMS module</a>). </p>
<p>The <a href="http://trac.seagullproject.org/wiki/Modules/Publisher">publisher module</a> requires a bit of hacking to make it run effectively, especially if the site requires content pages which have different layouts. But, overall the site works well and looks pretty good, even if I say so myself <img src='http://www.peeledcarrots.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . </p>
<p>I have still had a number of difficulties, so for those of you who are planning on building a similar site, here are some of the things which I have learnt:</p>
<p>This is especially relevant if you are going to be using some of the following:</p>
<ul>
<li><a href="http://seagullproject.org/">Seagull php Framework</a></li>
<li>Installing a site on a <a href="http://mediatemple.net/">Media Temple</a> Server</li>
<li>Including a dynamic <a href="http://www.google.com/apis/maps/">Google Map</a> in a page using the api</li>
</ul>
<p><strong>Lessons learned</strong></p>
<p>Tips for using the <a href="http://seagullproject.org/">Seagull</a> publisher module:</p>
<p>If you have various site sections which need to have different layouts, the best way of handling this is to create different content types for each different layout which is required.</p>
<p>Then create a different publisher template for that content type and specify the styling which you want for that particular section.</p>
<p>If you have any exceptions, then use a handler like this:</p>
<p><code>    {if:isEqual(29,articleID)}<br />
            <flexy:include src="about_flow.html" /><br />
   {end:}<br />
    {if:isEqual(30,articleID)}<br />
              <flexy:include src="about_approach.html" /><br />
    {end:}<br />
    {if:isEqual(34,articleID)}<br />
           <flexy:include src="products.html" /><br />
    {end:}</code></p>
<p>I will endeavour to write a more in depth tutorial for this and put it on the Seagull wiki. Once I have done so, I will update this post.</p>
<p><strong>Server Issues</strong></p>
<p>The first issue which I encountered was trying to do an installation on a staging sub-domain on a <a href="http://mediatemple.net/webhosting/dv/"> Media Temple Dedicated Virtual Server</a>, where php safe mode was turned on. I have written a <a href="http://www.technovated.com/2007/04/03/successfully-turning-off-php-safe-mode-removing-open_basedir-restrictions/">post </a>which is a guide on how to successfully remove these restrictions.</p>
<p><strong>Browser Issues</strong></p>
<p>As always, I encountered problems with cross browser compatibility. I discovered huge differences between IE6, IE7 and Firefox. The site looks best in Firefox, Safari and in IE6, but there are a few small differences on IE7.</p>
<p>I used this basic conditional block to include an IE hacks file for when a user views the site using IE.</p>
<p><code>< !--[if IE] >< style type="text/css" >@import "http://www.atalink.com/ themes/atalink/css/hacks/ie.css";< /style >< ![endif]-- ></code> (Remove spaces)</p>
<p><strong>Google Maps</strong></p>
<p>Although this is not that difficult to implement, I found quite a useful site called:</p>
<p><a href="http://www.gorissen.info/Pierre/maps/googleMapLocationv3.php">Google Maps latitude, longitude Popup </a>, which gives you the latitudes and longitude values for a specific location, which you use in the <a href="http://www.google.co.uk">Google </a>supplied javascript</p>
<p><strong>Design</strong></p>
<p>Although a designer may do a really good job and a client signs off a design, one has to be flexible enough to deal with client requests for changing of the layouts. Often the changes requested are quite valid and one should consider each request before just disagreeing.</p>
<p><strong>Content</strong></p>
<p>Again, I have been reminded about how important it is to have content ready and signed off, before beginning with development. It is amazing how much time can be wasted when you are waiting for pieces of content. Details about content should be agreed upon during initial agreements and no matter how difficult it may be, these agreements should be adhered to.</p>
<p><strong>Conclusion</strong></p>
<p>I have enjoyed working on this site and I have learnt a lot, in terms of development and in terms of communicating with clients.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/developing-a-cms-solution-on-mediatemple-with-the-seagull-php-framework-including-google-maps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to turn off PHP safe mode and remove open_basedir restrictions to install the Seagull PHP framework on a Media Temple sub domain</title>
		<link>http://www.peeledcarrots.com/successfully-turning-off-php-safe-mode-removing-open_basedir-restrictions/</link>
		<comments>http://www.peeledcarrots.com/successfully-turning-off-php-safe-mode-removing-open_basedir-restrictions/#comments</comments>
		<pubDate>Tue, 03 Apr 2007 09:37:42 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://soapbox.technovated.com/2007/04/03/successfully-turning-off-php-safe-mode-removing-open_basedir-restrictions/</guid>
		<description><![CDATA[Problem
I wanted to run an installation script on a sub-domain of a Dedicated-Virtual server hosted by Media Temple with a Plesk 7.5.4, but received the following php error message when I ran the script:
Warning: file_exists(): open_basedir restriction in effect.
Reason why the error occurs
The reason for this error is because, php safe mode is turned on [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong></p>
<p>I wanted to run an installation script on a sub-domain of a Dedicated-Virtual server hosted by Media Temple with a Plesk 7.5.4, but received the following php error message when I ran the script:</p>
<p><strong>Warning:</strong> file_exists(): open_basedir restriction in effect.</p>
<p><strong>Reason why the error occurs</strong></p>
<p>The reason for this error is because, php safe mode is turned on and because the open_basedir is set for each sub-domain. After quite a lot of searching on the web, I eventually tried a few tutorials, but none of them were comprehensive enough to describe exactly how to solve the actual problem.</p>
<p><strong>Solution</strong></p>
<p>Follow these steps and you should solve the problem:</p>
<ol>
<li>SSH into your server using the root login information </li>
<p></p>
<li>Once you have logged in, edit the php.ini file located  /etc/ folder with a text editor. The line you are looking for is:<br />
a. Change this line safe_mode = on to safe_mode = off<br />
b. Or you can cut and paste this one-liner: <br /> perl -p -i -e &#8217;s/^safe_mode\s*=\s*on/safe_mode = off/i;&#8217; /etc/php.ini
</li>
<p></p>
<li>Make sure that the open_basedir in the php.ini file looks like this:
<p><code>; open_basedir, if set, limits all file operations to the defined<br />
directory<br />
; and below. This directive makes most sense if used in a per-<br />
directory<br />
; or per-virtualhost web server configuration file. This directive is<br />
; *NOT* affected by whether Safe Mode is turned On or Off.<br />
open_basedir = none</code></p>
</li>
<p></p>
<li>Then you need to edit the virtual hosts for the domain and for each sub-domain in the http.inc file, which is located in the /var/www/vhosts/$domain/conf folder.<br />
Add the following section of code to the domain Virtual Host, as well as to each sub-domain Virtual Host</p>
<p><code><br />
< IfModule sapi_apache2.c ><br />
	php_admin_flag engine on<br />
	php_admin_flag safe_mode off<br />
	php_admin_value open_basedir none<br />
< /IfModule ></p>
<p>< IfModule mod_php5.c ><br />
	php_admin_flag engine on<br />
	php_admin_flag safe_mode off<br />
	php_admin_value open_basedir none<br />
< /IfModule ><br />
</code>
 </li>
<p></p>
<li>To complete the process, one needs to type the following two commands:</li>
<p>a. /etc/init.d/httpd stop<br />
b. /etc/init.d/httpd start</p>
<p>Hit â€œEnterâ€? after each command and you should be given an [ OK ] status in the command line.</p>
<p><strong>Conclusion</strong></p>
<p>This should solve your problem and if you have any comments, suggestions or improvements, please submit them. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/successfully-turning-off-php-safe-mode-removing-open_basedir-restrictions/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Acceptance testing PHP using selenium</title>
		<link>http://www.peeledcarrots.com/acceptance-testing-php-using-selenium/</link>
		<comments>http://www.peeledcarrots.com/acceptance-testing-php-using-selenium/#comments</comments>
		<pubDate>Fri, 26 Jan 2007 10:09:42 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://soapbox.technovated.com/2007/01/26/acceptance-testing-php-using-selenium/</guid>
		<description><![CDATA[As we are approaching the final stages of one of out projects, I have been doing some serious acceptance testing to make sure that the site is functioning correctly. To set the testing up, I was given a steer in the right direction and used the Seagull wiki as a guide for the installation&#8230;.hat tip [...]]]></description>
			<content:encoded><![CDATA[<p>As we are approaching the final stages of one of out projects, I have been doing some serious acceptance testing to make sure that the site is functioning correctly. To set the testing up, I was given a steer in the right direction and used the <a href="http://trac.seagullproject.org/wiki/Standards/UnitTesting#UsingSeleniumforAcceptanceTests">Seagull wiki </a>as a guide for the installation&#8230;.hat tip to Demian.</p>
<p>It is really easy to set the test suite up and to get going, all you really need are the following two downloads:</p>
<ol>
<li><a href="http://www.openqa.org/selenium-core/download.action">Selenium core test suite</a></li>
<li>To record tests the <a href="http://www.openqa.org/selenium-ide/ ">Selenium IDE</a> in Firefox</li>
</ol>
<p>Once you have installed the Selenium core web application and the plug-in for Firefox (Firefox rocks!!) you good to go:</p>
<ol>
<li>Plan the various tests which you would like to run</li>
<li>Set the Firefox IDE to record your actions</li>
<li>Once you&#8217;ve completed a certain test save the test in an .html file</li>
<li>Include a link to your test file in your main index.html (TestSuite) file, which acts as a table of contents for the various tests</li>
<li>Then you can either run the tests individually or as a batch</li>
</ol>
<p>If you would like a <a href="http://blog.thinkphp.de/archives/133-Practical-Testing-PHP-Applications-with-Selenium.html">more detailed tutorial</a>, I found the one on the <a href="http://blog.thinkphp.de/">thinkPHP blog</a> to be quite useful.</p>
<p>As Demian says, you start getting &#8220;addicted&#8221; to creating tests and eventually try to become a perfectionist &#8211; which is a good place to be in if you want to produce error free sites for clients.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/acceptance-testing-php-using-selenium/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting to grips with PEAR Quickform and Smarty</title>
		<link>http://www.peeledcarrots.com/getting-to-grips-with-pear-quickform-and-smarty/</link>
		<comments>http://www.peeledcarrots.com/getting-to-grips-with-pear-quickform-and-smarty/#comments</comments>
		<pubDate>Thu, 26 Oct 2006 09:41:36 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://soapbox.technovated.com/2006/10/26/getting-to-grips-with-pear-quickform-and-smarty/</guid>
		<description><![CDATA[Over the past few months, we have done a number of projects using the php Smarty package. Smarty is a fantastic templating engine which is quite easy to use and is extremely powerful. It also enforces the distinction between presentation logic and application logic and provides a great deal of flexibility when developing.
On our most [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past few months, we have done a number of projects using the <a href="http://www.php.net/">php </a><a href="http://smarty.php.net/">Smarty</a> package. Smarty is a fantastic <a href="http://en.wikipedia.org/wiki/Templating_engine">templating engine</a> which is quite easy to use and is extremely powerful. It also enforces the distinction between presentation logic and application logic and provides a great deal of flexibility when developing.</p>
<p>On our most recent project we decided to try and use the php <a href="http://pear.php.net/">PEAR</a> <a href="http://pear.php.net/package/html_quickform/redirected">Quickform</a> module. This has also proved to be a easy to use, yet powerful form generator and processor.One thing which I think needs improving is that when forms are generated, the <a href="http://en.wikipedia.org/wiki/HTML">HTML</a> templates are table based. I am sure that the developers of this package are trying to implement this feature on later realeases, but the package we are using doesn&#8217;t generate semantically correct HTML forms.</p>
<p>However, to overcome this sticking point, we combined the smarty and quickform packages to produce semantically correct HTML templates, which have validation and processing ability.</p>
<p>The form generation, validation form processing are extremely quick and provide an awesome amount of felxibility when it comes to both presentation and application logic.</p>
<p>It is truly awesome what can be acheived using open source code.<br />
Go php!!! <img src='http://www.peeledcarrots.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>For those of you who are intrested in learning about quickform and smarty-check these links out:</p>
<ul>
<li><a href="http://www.devarticles.com/c/a/Web-Design-Usability/Using-HTML-QuickForm-To-Manage-Web-Forms-Part-1/">Devarticle</a></li>
<li><a href="http://davidmintz.org/presentations/show.php/QuickForm_and_Smarty/">David Mintz</a></li>
<li><a href="http://www.midnighthax.com/quickform.php">Midnighthax</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/getting-to-grips-with-pear-quickform-and-smarty/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
