<?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>Bizzie Bee Consulting Ltd</title>
	<atom:link href="http://www.bizzie.biz/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bizzie.biz</link>
	<description>Specialising in Systems Integration</description>
	<lastBuildDate>Mon, 02 Jan 2012 09:12:35 +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>No TCPIP on mysql using Zend</title>
		<link>http://www.bizzie.biz/2012/01/no-tcpip-on-mysql-using-zend/</link>
		<comments>http://www.bizzie.biz/2012/01/no-tcpip-on-mysql-using-zend/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 13:10:09 +0000</pubDate>
		<dc:creator>rob.langley@bizzie.biz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[ZEND]]></category>

		<guid isPermaLink="false">http://www.bizzie.biz/?p=367</guid>
		<description><![CDATA[Over the last few weeks I have been evaluating Zend Studio used in conjunction Zend Server CE on my Mac Book in order to improve debugging of my php / wordpress sites. As I already had an installation of MySQL &#8230; <a href="http://www.bizzie.biz/2012/01/no-tcpip-on-mysql-using-zend/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Over the last few weeks I have been evaluating Zend Studio used in conjunction Zend Server CE on my Mac Book in order to improve debugging of my php / wordpress sites.</p>
<p>As I already had an installation of MySQL and used MySQL Workbench to administer it I was getting a little confused when using phpMyAdmin as provide by Zend Server CE and seeing a different set of databases.</p>
<p>I soon realised that I had 2 installations of MySQL, my original using TCPIP/3306 and a new Zend Version using Unix Sockets (tcpip disabled).  This was not really practical for me. So my solution was to remove my original installation and enable tcpip on my Zend version. THIS DESTROYED my original databases, which was not an issue for me as I had them backed up.</p>
<p>Once the original was uninstalled, I rebooted and verified the Zend version with phpMyAdmin and also from the command line with mysql.</p>
<h2>Enabling TCPIP in MySQL Zend Edition</h2>
<p>The configuration file for mySQL on my Mac was located at</p>
<blockquote><p>/usr/local/zend/mysql/data/my.cnf</p></blockquote>
<p>Unfortunately the data folder was locked as shown below</p>
<blockquote><p>Robs-MacBook-Pro:mysql rob$ ls -l</p>
<p>total 0<br />
drwxr-xr-x  49 root  wheel  1666 13 Dec 19:16 bin<br />
drwxr-x&#8212;  13 zend  wheel   442 31 Dec 08:10 data<br />
drwxr-x&#8212;   6 root  wheel   204  4 Sep 14:36 data.dist<br />
drwxr-xr-x  23 root  wheel   782 13 Dec 19:16 lib<br />
drwxr-xr-x   3 root  wheel   102 13 Dec 19:16 scripts<br />
drwxr-xr-x  13 root  wheel   442 13 Dec 19:16 share<br />
drwxr-xr-x   3 zend  wheel   102 31 Dec 08:10 tmp</p></blockquote>
<p>So first I need to unlock the data folder using chmod</p>
<blockquote><p>sudo chmod 777 data</p></blockquote>
<p>Now I was able to enter the data folder and open my.cnf for editing. Personally I use textwrangler to edit as I like the &#8216;hidden&#8217; option which allows my to navigate to folders usually hidden my MacOSx.</p>
<p>The only minor change here was to comment out the line below, thus enabling TCP/IP the same file already defined the default port of 3306, which was fine in my case.</p>
<blockquote><p>#skip-networking</p></blockquote>
<p>As a last step I switched the security back on for the data folder, as shown below then verified it with ls -l</p>
<blockquote><p>sudo chmod 750 data</p></blockquote>
<p>Again I restarted mySQL and now can happily connect to the MySQL databases using Workbench, phpMyAdmin and the command line.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bizzie.biz/2012/01/no-tcpip-on-mysql-using-zend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL not starting after Zend install</title>
		<link>http://www.bizzie.biz/2011/12/mysql-not-starting-zend/</link>
		<comments>http://www.bizzie.biz/2011/12/mysql-not-starting-zend/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 16:24:09 +0000</pubDate>
		<dc:creator>rob.langley@bizzie.biz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[ZEND]]></category>

		<guid isPermaLink="false">http://www.bizzie.biz/?p=372</guid>
		<description><![CDATA[Whilst playing with Zend Server Community Edition trying to get mySQL to work I found myself at a point where mySQL would not start. sudo zendctl.sh start-mysql Starting MySQL . ERROR! Manager of pid-file quit without updating file. I had &#8230; <a href="http://www.bizzie.biz/2011/12/mysql-not-starting-zend/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Whilst playing with Zend Server Community Edition trying to get mySQL to work I found myself at a point where mySQL would not start.<br />
<code><br />
sudo zendctl.sh start-mysql<br />
Starting MySQL<br />
. ERROR! Manager of pid-file quit without updating file.<br />
</code></p>
<p>I had tried removing ZEND Server completely as documented on the Zend site. At best this is a bit vague.</p>
<ul>
<li>Stop all Zend Server processes</li>
<li>Delete all Zend Server installed files</li>
<li>Remove the .app from /Applications</li>
<li>Remove Zend users</li>
</ul>
<p>No matter what I did I always got the same error after re installing.  So after looking round the file structure I tried running a script called uninstall located in the Zend bin folder.  This asks a few questions but after completing the process and re installing, then all now seems to work <img src='http://www.bizzie.biz/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><code><br />
Robs-MacBook-Pro:bin rob$ sudo /usr/local/zend/bin/uninstall.sh<br />
Are you sure you wish to completely remove Zend Server? [yes|no]<br />
yes<br />
Stopping Zend Server 5.5.0 ..</p>
<p>httpd: Could not reliably determine the server's fully qualified domain name, using Robs-MacBook-Pro.local for ServerName<br />
/usr/local/zend/bin/apachectl stop [OK]<br />
Stopping Zend Server GUI [Lighttpd] [OK]<br />
ERROR! MySQL manager or server PID file could not be found!<br />
Stopping Java bridge [OK]</p>
<p>Zend Server stopped.<br />
/usr/local/zend/apache2/htdocs and /usr/local/zend/mysql will be removed during this operation, if you wish to backup your PHP code and MySQL DBs,<br />
please do so now and type "cont" to continue.<br />
cont<br />
Robs-MacBook-Pro:bin rob$<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bizzie.biz/2011/12/mysql-not-starting-zend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Apache and Virtual Hosts</title>
		<link>http://www.bizzie.biz/2011/12/zend-apache-and-virtual-hosts/</link>
		<comments>http://www.bizzie.biz/2011/12/zend-apache-and-virtual-hosts/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 09:14:51 +0000</pubDate>
		<dc:creator>rob.langley@bizzie.biz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Mac OSx]]></category>
		<category><![CDATA[ZEND]]></category>

		<guid isPermaLink="false">http://www.bizzie.biz/?p=379</guid>
		<description><![CDATA[Over the last few months I have spent more time getting in to php development, this has been mainly for WordPress themes thou I also have written a few simple Web Services. Whilst the live versions of these are hosted &#8230; <a href="http://www.bizzie.biz/2011/12/zend-apache-and-virtual-hosts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Over the last few months I have spent more time getting in to php development, this has been mainly for WordPress themes thou I also have written a few simple Web Services. Whilst the live versions of these are hosted externally I like to be able to develop on my laptop disconnected from the internet, eg whilst traveling on trains. This mean I have configured a number of sites using virtual hosts on my laptop.</p>
<p>Working with .Net developers who use Visual Studio my biggest frustration is issues I have is the pain in debugging PHP code, having to put excessieve manual code and logging which can be time consuming.  Thou I do include logging for general fault finding.  What I was missing was the ability to step through code in a similar fashion to Visual Studio.  After some research I discovered that Zend Server CE (free) in conjunction with Zend Studio (€299) appears to do this.</p>
<p>So with a 30 day trial of Zend Studio installed I decided to set up an environment on my laptop with the hope it would deliver, and I would then justify the €299 spend against the time I will save.</p>
<p>So this article discusses how I configured Apache under Zend to use the default port of 80 with host headers on my MacBook Pro running MacOSx 10.7 (Lion). The first thing to be aware of is that the Zend Server CE install, installs its own version of Apache under /usr/local/zend/apache2 so it is highly likely that you already have a default version under /private/etc/apache2.  In addition it installs its own light wieght web server for the administrive web site, so you can access the config via a browser even with Apache stopped.</p>
<h2>Adding Zend to the Path</h2>
<p>To make things easier and allow your system to find the Zend executables and scripts add the Zend Bin folder to the Path.</p>
<p>The Path file is located at <code>/private/etc/paths</code></p>
<p>Now add the line <code>/usr/local/zend/bin</code></p>
<h2>Apache httpd.conf changes</h2>
<h3>Set the port number</h3>
<p>The Apache config file httpd.conf for the Zend installation is installed at <code>/usr/local/zend/apache2/conf/httpd.conf</code>. I recommend you first make a back of this either from the command line using</p>

<div class="wp_syntax"><div class="code"><pre class="" style="font-family:monospace;">sudo cp httpd.conf http.conf.org</pre></div></div>

<p>or just using &#8216;Save As&#8217; with a Gui based tool such as Textwrangler.</p>
<p>At around line 40, comment our the original line enabling port 10088 and add a line for port 80 as shown below</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>40
41
</pre></td><td class="code"><pre class="" style="font-family:monospace;">#Listen <span style="">10088</span>
Listen <span style="">80</span></pre></td></tr></table></div>

<h3>Change the Documents Folder</h3>
<p>In this example my Sites folder is under my user name of rob.  This should be changed to your username in the examples below.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>105
106
</pre></td><td class="code"><pre class="" style="font-family:monospace;">#DocumentRoot &quot;/usr/local/zend/apache2/htdocs&quot;
DocumentRoot &quot;/Users/rob/Sites&quot;</pre></td></tr></table></div>

<p>Also change the documents folder as shown below, again I just comment out the original line at 134, the rest of the listing is just shown for completeness.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
</pre></td><td class="code"><pre class="" style="font-family:monospace;">#
# This should be changed to whatever you set DocumentRoot to.
#
#&lt;Directory &quot;/usr/local/zend/apache2/htdocs&quot;&gt;
&lt;Directory &quot;/Users/rob/Sites&quot;&gt;
    #
    # Possible values for the Options directive are &quot;None&quot;, &quot;All&quot;,
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that &quot;MultiViews&quot; must be named *explicitly* --- &quot;Options All&quot;
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/<span style="">2.2</span>/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks
&nbsp;
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be &quot;All&quot;, &quot;None&quot;, or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All
&nbsp;
    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all
&nbsp;
&lt;/Directory&gt;</pre></td></tr></table></div>

<h3>Enabling the Virtual Host file</h3>
<p>Finally uncomment the include statement for the virtual host file.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>391
392
</pre></td><td class="code"><pre class="" style="font-family:monospace;"># Virtual hosts
Include conf/extra/httpd-vhosts.conf</pre></td></tr></table></div>

<p>Now exit and save the httpd.conf file</p>
<h2>Adding Virtual Host Entries</h2>
<p>Next we need to edit the file enabled in the previous section, backup then open the file <code>/usr/local/zend/apache2/conf/extra/httpd-vhosts.conf</code></p>
<h3>Set the port number</h3>
<p>First change the port number that Apache will use in the virtual host file from 10088 to 80</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>391
392
</pre></td><td class="code"><pre class="" style="font-family:monospace;">#NameVirtualHost *:<span style="">10088</span>
NameVirtualHost *:<span style="">80</span></pre></td></tr></table></div>

<h3>Add your site entries</h3>
<p>Now we need to disable or delete the 2 default site entries provided by Zend and add our own entries. The example below shows the original entries just commented out and my 3 new sites added to the end</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
</pre></td><td class="code"><pre class="" style="font-family:monospace;">#&lt;VirtualHost *:<span style="">10088</span>&gt;
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot &quot;/usr/local/zend/apache2/docs/dummy-host.example.com&quot;
#    ServerName dummy-host.example.com
#    ServerAlias www.dummy-host.example.com
#    ErrorLog &quot;logs/dummy-host.example.com-error_log&quot;
#    CustomLog &quot;logs/dummy-host.example.com-access_log&quot; common
#&lt;/VirtualHost&gt;
&nbsp;
#&lt;VirtualHost *:<span style="">10088</span>&gt;
#    ServerAdmin webmaster@dummy-host2.example.com
#    DocumentRoot &quot;/usr/local/zend/apache2/docs/dummy-host2.example.com&quot;
#    ServerName dummy-host2.example.com
#    ErrorLog &quot;logs/dummy-host2.example.com-error_log&quot;
#    CustomLog &quot;logs/dummy-host2.example.com-access_log&quot; common
#&lt;/VirtualHost&gt;
&nbsp;
&lt;VirtualHost *:<span style="">80</span>&gt;
    ServerAdmin rob.langley@me.com
    DocumentRoot &quot;/Users/rob/Sites/intranet&quot;
    ServerName localhost
    ServerAlias intranet
    ErrorLog &quot;/Users/rob/Sites/logs/intranet_error_log&quot;
    CustomLog &quot;/Users/rob/Sites/logs/intranet-access_log&quot; commonvhost
&lt;/VirtualHost&gt;
&nbsp;
&nbsp;
&lt;VirtualHost *:<span style="">80</span>&gt;
    ServerAdmin rob.langley@me.com
    DocumentRoot &quot;/Users/rob/Sites/helloWorld&quot;
    ServerName localhost
    ServerAlias hello
    ErrorLog &quot;/Users/rob/Sites/logs/hello_error_log&quot;
    CustomLog &quot;/Users/rob/Sites/logs/hello-access_log&quot; commonvhost
&lt;/VirtualHost&gt;
&nbsp;
&nbsp;
 &lt;VirtualHost *:<span style="">80</span>&gt;
    ServerAdmin rob.langley@me.com
    DocumentRoot &quot;/Users/rob/Sites/florida-paradise-villas <span class="br0">&#40;</span>Wordpress<span class="br0">&#41;</span>&quot;
    ServerName localhost
    ServerAlias fpv
    ErrorLog &quot;/Users/rob/Sites/logs/fpv_error_log&quot;
    CustomLog &quot;/Users/rob/Sites/logs/fpv-access_log&quot; common
&lt;/VirtualHost&gt;</pre></td></tr></table></div>

<p>You will see in my config above I use server aliases such as fpv and hello so I can access my local sites with http://fpv and http://hello. In order for these addresses to resolve to localhost you need to add them to your host file located at /private/etc/hosts</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>12
13
14
15
16
</pre></td><td class="code"><pre class="" style="font-family:monospace;">#Custom Settings - R Langley
# web sites
127.0.0.1	intranet
127.0.0.1	fpv
127.0.0.1	hello</pre></td></tr></table></div>

<h2>Auto Starting Zend Apache</h2>
<p>The final step is ensure the Zend Version of Apache starts as opposed to the default Mac version.  This is to prevent confusion and also a conflict as they are now both configured to use port 80.</p>
<p>I achieved this by effectively repointing the default apachectl to the Zend version of Apache so when the system start Apache it starts Zend version as opposed to the default.</p>
<p>First stop the current version of apache if its still running</p>
<pre>apachectl stop</pre>
<p>Next you need to move the current version to a safe place in case you need it in the future. The file is located at <code>/usr/sbin/apachectl</code> and can be moved with</p>
<pre>
sudo mv /usr/sbin/apachectl /Users/rob/SafePlace
</pre>
<p>Where &#8216;rob&#8217; above is my personal user folder and should be changed to yours or an alternate location.</p>
<p>Now with the original version of the file removed we can create a link too Zend</p>
<pre>cd /usr/sbin
sudo ln -s /usr/local/zend/apache2/bin/apachectl ./</pre>
<p>Now you should be able to start the new version of Apache with </p>
<pre>apachectl start</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bizzie.biz/2011/12/zend-apache-and-virtual-hosts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 7 not seeing allocated diskspace</title>
		<link>http://www.bizzie.biz/2011/09/windows-7-not-seeing-allocated-diskspace/</link>
		<comments>http://www.bizzie.biz/2011/09/windows-7-not-seeing-allocated-diskspace/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 05:44:10 +0000</pubDate>
		<dc:creator>rob.langley@bizzie.biz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[VMWare]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.bizzie.biz/?p=351</guid>
		<description><![CDATA[I have a virtualised version of Windows 7 Ultimate running on my Macbook Pro under VMware Fusion 4. The C drive having 50Gb was becoming quite full so I shut down the VM and allocated an additional 20Gb. After restarting &#8230; <a href="http://www.bizzie.biz/2011/09/windows-7-not-seeing-allocated-diskspace/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have a virtualised version of Windows 7 Ultimate running on my Macbook Pro under VMware Fusion 4.  The C drive having 50Gb was becoming quite full so I shut down the VM and allocated an additional 20Gb.  After restarting I went in to disk manager and disk tools and saw the new partition was now 70Gb and fully extended, however if I right clicked the actual C drive it reported only 50Gb.  Looking in the actual VM package from my Mac I could see the appropriate number of 2Gb vmdk files totalling 70Gb.  This seemed very strange so I tried updating vmware tools, running chkdsk, rebooting all without success.  In the meantime I allocated another 15Gb but still the actual C drive reported 50Gb in explorer but now disk manager report 85Gb.</p>
<p>I discovered that the &#8216;extend filesystem&#8217; command in diskpart fixes this.</p>
<p><code><br />
>diskpart</p>
<p>DISKPART> list disk</p>
<p>  Disk ###  Status         Size     Free     Dyn  Gpt<br />
  --------  -------------  -------  -------  ---  ---<br />
  Disk 0    Online           85 GB      0 B</p>
<p>DISKPART> select disk 1</p>
<p>The disk you specified is not valid.</p>
<p>There is no disk selected.</p>
<p>DISKPART> list disk</p>
<p>  Disk ###  Status         Size     Free     Dyn  Gpt<br />
  --------  -------------  -------  -------  ---  ---<br />
  Disk 0    Online           85 GB      0 B</p>
<p>DISKPART> select disk 0</p>
<p>Disk 0 is now the selected disk.</p>
<p>DISKPART> list partition</p>
<p>  Partition ###  Type              Size     Offset<br />
  -------------  ----------------  -------  -------<br />
  Partition 1    Primary             84 GB  1024 KB</p>
<p>DISKPART> select partition 1</p>
<p>Partition 1 is now the selected partition.</p>
<p>DISKPART> list volume</p>
<p>  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info<br />
  ----------  ---  -----------  -----  ----------  -------  ---------  --------<br />
  Volume 0     D                       DVD-ROM         0 B  No Media<br />
* Volume 1     C                NTFS   Partition     84 GB  Healthy    System</p>
<p>DISKPART> select volume 1</p>
<p>Volume 1 is the selected volume.</p>
<p>DISKPART> extend filesystem<br />
DiskPart successfully extended the file system on the volume.</p>
<p>DISKPART></p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bizzie.biz/2011/09/windows-7-not-seeing-allocated-diskspace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Apache after Lion 10.7 Install</title>
		<link>http://www.bizzie.biz/2011/08/setting-up-apache-after-lion-10-7-install/</link>
		<comments>http://www.bizzie.biz/2011/08/setting-up-apache-after-lion-10-7-install/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 20:59:26 +0000</pubDate>
		<dc:creator>rob.langley@bizzie.biz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Mac OSx]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bizzie.biz/?p=317</guid>
		<description><![CDATA[I have just bought a new 256Gb SSD for my Mac Book Pro to upgrade my 128Gb SSD which I installed some months ago to have a test of SSD and performance (its awesome). I took this opportunity to perform &#8230; <a href="http://www.bizzie.biz/2011/08/setting-up-apache-after-lion-10-7-install/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have just bought a new 256Gb SSD for my Mac Book Pro to upgrade my 128Gb SSD which I installed some months ago to have a test of SSD and performance (its awesome).  I took this opportunity to perform a CLEAN install of OSx Lion 10.7 leaving my original SSD in a USB caddie with 10.6 (Snow Leopard).</p>
<p>On my old disk I ran several development sites using Apache / PHP / MySQL using a combination of the hosts file and virtual hosts in Apache.</p>
<p>This blog documents the process I went through in migrating my sites from a Snow Leopard (10.6) to a new clean installation of Lion (10.7).</p>
<h2>Tasks on Lion 10.7 Installation</h2>
<p>First I enabled &#8216;Web Sharing&#8217; under system preferences, and tested I could access http://localhost from a browser.</p>
<p>Next I copied my original files under /volumes/ssd/users/rob/sites to the new disk at /volumes/ssd240/users/rob/sites where rob is my user folder.</p>
<p>Then I backed up the default host file located in /private/etc/ and added my own aliases such as those shown below.<br />
<code><br />
127.0.0.1	bizziebee<br />
127.0.0.1	intranet<br />
</code></p>
<p>Lion seems to have a higher level of file security on file system so I had to change this on a few of my files in order to be able to modify the key configuration files in apache.  So using terminal I modified the following.</p>
<p><code><br />
cd /private/etc/apache2<br />
sudo chmod u+w httpd.conf</code></p>
<p><code> </code></p>
<p><code>cd /private/etc/apache2/extra<br />
chmod u+w httpd-vhosts.conf<br />
</code></p>
<p>Using textwrangler which allows you to view hidden files, I opened my original httpd-vhosts.conf file and merged it into the new version. Note as my new disk had a new Volume label I had to rename these from SSD to SSD240</p>
<p><code><br />
&lt;VirtualHost *:80&gt;<br />
ServerAdmin rob.langley@me.com<br />
DocumentRoot "/Volumes/SSD240/Users/Rob/Sites/intranet"<br />
ServerName localhost<br />
ServerAlias intranet<br />
ErrorLog "/Volumes/SSD240/Users/Rob/Sites/logs/intranet_error_log"<br />
CustomLog "/Volumes/SSD240/Users/Rob/Sites/logs/intranet-access_log" common<br />
&lt;/VirtualHost&gt;<br />
</code></p>
<p>Next we need to modify the default httpd.conf file.</p>
<ol>
<li>Enable PHP support by deleting the leading # around line 111</li>
<p><code>LoadModule php5_module libexec/apache2/libphp5.so</code></p>
<li>Enable Virtual hosts by deleting the leading # around line 626</li>
<p><code>Include /private/etc/apache2/extra/httpd-vhosts.conf</code></ol>
<p>Now lets restart apache and test our settings so far. From terminal type.<br />
<code>sudo httpd -k restart</code></p>
<h2>MySQL Migration</h2>
<p>First I installed a new copy of MySQL Community followed by MySQL Workbench to administrate it.  Both these installations were simple and straight forward but my machine did require a reboot in order to start mysql.</p>
<h3>Copying Configuration from MySQL workbench</h3>
<p>Obviously my new installation of MySQL workbench did not have any of the original connections or server instances.  So rather than have to remember them all I copied two xml files from my orignal disk.  The xml files were located as follows.<br />
<code><br />
/Volumes/SSD/Users/Rob/Library/Application Support/MySQL/Workbench/connections.xml<br />
/Volumes/SSD/Users/Rob/Library/Application Support/MySQL/Workbench/server_instances.xml<br />
</code><br />
<a style="color: #ff4b33;" href="http://www.bizzie.biz/wp-content/uploads/2011/08/mySQL.png"><img class="alignleft size-medium wp-image-332" style="border-style: initial; border-color: initial;" title="mySQL Workbench Configuration" src="http://www.bizzie.biz/wp-content/uploads/2011/08/mySQL-300x214.png" alt="Copying MySQL xml files" width="300" height="214" /></a>Now start MySQL workbench to find all your saved connections <img src='http://www.bizzie.biz/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Your local databases can now be exported from your original installation by booting into your original disk and creating and export (dump) and saving the file in a common location.  I actually created one dump for all my schemas and this seemed to work.  Then start you new OS (Lion) and import these files  in to your new MySQL installation.</p>
<h3>MySQL Sockets</h3>
<p>It appears that the location of mysql.sock has moved in Lion from var/mysql/mysql.sock to tmp/mysql.sock  This is defined in /private/etc/php.ini.  Unfortunately this file also appear to have been renamed to php.ini.default.  So&#8230;.</p>
<ul>
<li>Stop the web server &#8216;sudo apachectl stop&#8217;</li>
<li>copy php.ini.default to php.ini</li>
<li>Edit php.ini and Search and Replace &#8216;var/mysql/mysql.sock&#8217; to &#8216;tmp/mysql.sock&#8217;</li>
<li>Restart the web server &#8217;sudo apachectl start&#8217;</li>
</ul>
<p>Thanks to <a title="MySQL.sock and Lion 10.7" href="http://birdchan.com/home/2011/07/20/osx-lion-mysql-sock-path/" target="_blank">Brian Chans blog</a> for the info on mysql.sock</p>
<p>Thats it, I now have my sites running under Lion.  I hope this may be of some help to some people.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bizzie.biz/2011/08/setting-up-apache-after-lion-10-7-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Webservice and MySQL</title>
		<link>http://www.bizzie.biz/2011/08/php-webservice-mysql/</link>
		<comments>http://www.bizzie.biz/2011/08/php-webservice-mysql/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 06:38:20 +0000</pubDate>
		<dc:creator>rob.langley@bizzie.biz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Mac OSx]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SOAP]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.bizzie.biz/?p=259</guid>
		<description><![CDATA[In this post I will document some recent research I did in writing a basic PHP SOAP Web Service to return a set of data from a MySQL database.  Having recently purchased an iPad I wanted to write an application &#8230; <a href="http://www.bizzie.biz/2011/08/php-webservice-mysql/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In this post I will document some recent research I did in writing a basic PHP SOAP Web Service to return a set of data from a MySQL database.  Having recently purchased an iPad I wanted to write an application for personal use which will query an existing MySQL database.  Therefore I researched and developed this code standlone on my Mac Book Pro running the default install of Apache and a download of MySQL.</p>
<p>The first thing I did is wrote a basic Stored Routine using MySQL Workbench to return a set of data.</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">DEFINER</span><span style="color: #CC0099;">=</span><span style="color: #008000;">`root`</span>@<span style="color: #008000;">`localhost`</span> <span style="color: #990099; font-weight: bold;">PROCEDURE</span> <span style="color: #008000;">`sr<span style="color: #008080; font-weight: bold;">_</span>RetrieveBasicBookingDetailsList`</span><span style="color: #FF00FF;">&#40;</span><span style="color: #990099; font-weight: bold;">IN</span> days <span style="color: #999900; font-weight: bold;">int</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #990099; font-weight: bold;">BEGIN</span>
<span style="color: #990099; font-weight: bold;">SELECT</span> b.bookingRef<span style="color: #000033;">,</span> b.customerId<span style="color: #000033;">,</span> <span style="color: #000099;">CONCAT_WS</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">' '</span><span style="color: #000033;">,</span>c.lastname<span style="color: #000033;">,</span> c.firstname<span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">as</span> customerFullName<span style="color: #000033;">,</span> b.state<span style="color: #000033;">,</span> b.startDate<span style="color: #000033;">,</span> b.endDate<span style="color: #000033;">,</span> b.bookingDate<span style="color: #000033;">,</span> b.totalCost<span style="color: #000033;">,</span> <span style="color: #008080;">0</span> <span style="color: #990099; font-weight: bold;">as</span> Owing
<span style="color: #990099; font-weight: bold;">FROM</span> bookings <span style="color: #990099; font-weight: bold;">as</span> b
<span style="color: #990099; font-weight: bold;">INNER</span> <span style="color: #990099; font-weight: bold;">JOIN</span> client c <span style="color: #990099; font-weight: bold;">on</span> b.customerId <span style="color: #CC0099;">=</span> c.customerId
<span style="color: #990099; font-weight: bold;">WHERE</span> startDate <span style="color: #CC0099;">&amp;</span>gt<span style="color: #000033;">;</span> <span style="color: #000099;">DATE_SUB</span><span style="color: #FF00FF;">&#40;</span><span style="color: #000099;">now</span><span style="color: #FF00FF;">&#40;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span> <span style="color: #CC0099; font-weight: bold;">INTERVAL</span> days <span style="color: #9900FF; font-weight: bold;">DAY</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #990099; font-weight: bold;">ORDER BY</span> startDate <span style="color: #990099; font-weight: bold;">ASC</span><span style="color: #000033;">;</span>
<span style="color: #009900;">END</span></pre></div></div>

<p>The inner workings of the above stored routine does not really matter except to say that you can pass it a single integer value which represents the number of days.  The Stored Routine then returns a set of data based on this value.  With the Stored Routine written and tested it was time to move on to writing my the PHP Web Service.  In order to simplify development I chose to use the library nusoap which is available at <a title="SorceForge NUSOAP" href="http://sourceforge.net/projects/nusoap/" target="_blank">SorceForge</a></p>
<p>Line 1 &#8211; 3: Define library location for NUSoap and also config location for global variable such as Database credentials.</p>
<p>Line 4 -9: Create SOAP object and define namespace.</p>
<p>Line 10-30: Create an complex dataType called bookingBasicDetail to each booking record returned from the database</p>
<p>Line 33-45: Create an array to be returned by the web service, is an array of bookingBasicDetails so will contain the complete dataset returned fromt the database.</p>
<p>Line 48-58: Now define the actual web service.</p>
<p>Line 59: Define function to be called by webservice</p>
<p>Line 60-67: Open a database connection and return a soap fault if there is an error such as bad password or database not found.</p>
<p>Line 69-73: Call Stored Routine passing in the single integer value &#8216;days&#8217;.  Return a Soap Fault if anything errors. </p>
<p>Line 78-96: Iterate through each rowset returned by stored routine, mapping the columns (fields) to variables within the array.  For example startDate is the 5th field in the rowset returned.</p>
<p>Line 98-101: Close database and return results from function to web service.</p>
<p>Line 104 &#8211; 105: Set up HTTP for web service<br />
<code></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'../config.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'../lib/nusoap.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Create the server instance</span>
    <span style="color: #000088;">$server</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> soap_server<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Initialize WSDL support</span>
    <span style="color: #000088;">$server</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">configureWSDL</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'villaQuoter.bookings'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'urn:villaQuoter.bookings'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
	<span style="color: #666666; font-style: italic;">//Define a STRUCT for 'simple quote details' conatins a minimum set of fields including:</span>
	<span style="color: #666666; font-style: italic;">//	state, bookingRef, customerId, startDate, endDate, bookingDate, Customer Full Name, Total Cost, Amount Owing    	</span>
    <span style="color: #000088;">$server</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">wsdl</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addComplexType</span><span style="color: #009900;">&#40;</span>
    	<span style="color: #0000ff;">'basicBookingDetails'</span><span style="color: #339933;">,</span>		<span style="color: #666666; font-style: italic;">//Name of Type</span>
    	<span style="color: #0000ff;">'complexType'</span><span style="color: #339933;">,</span>				<span style="color: #666666; font-style: italic;">//Type Class (Complex)</span>
    	<span style="color: #0000ff;">'struct'</span><span style="color: #339933;">,</span>					<span style="color: #666666; font-style: italic;">//php Type (Struct)</span>
    	<span style="color: #0000ff;">'all'</span><span style="color: #339933;">,</span>						<span style="color: #666666; font-style: italic;">//Compisitor??</span>
    	<span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>							<span style="color: #666666; font-style: italic;">//Restriction Base</span>
    	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
			<span style="color: #0000ff;">'state'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'state'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'xsd:int'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    		<span style="color: #0000ff;">'bookingRef'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'bookingRef'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'xsd:string'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    		<span style="color: #0000ff;">'customerId'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'customerId'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'xsd:string'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    		<span style="color: #0000ff;">'customerFullName'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'customerFullName'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'xsd:string'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    		<span style="color: #0000ff;">'startDate'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'startDate'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'xsd:string'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    		<span style="color: #0000ff;">'endDate'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'endDate'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'xsd:string'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    		<span style="color: #0000ff;">'bookingDate'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'bookingDate'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'xsd:string'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    		<span style="color: #0000ff;">'totalCost'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'totalCost'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'xsd:string'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    		<span style="color: #0000ff;">'amountOwing'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'amountOwing'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'xsd:string'</span><span style="color: #009900;">&#41;</span>
    	<span style="color: #009900;">&#41;</span>		
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
	<span style="color: #666666; font-style: italic;">//Create an ARRAY of data type BasicBookingDetails (this will be returned by the Web Service)</span>
    <span style="color: #000088;">$server</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">wsdl</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addComplexType</span><span style="color: #009900;">&#40;</span>
    	<span style="color: #0000ff;">'arrBasicBookingDetails'</span><span style="color: #339933;">,</span>		<span style="color: #666666; font-style: italic;">//Name of Array</span>
    	<span style="color: #0000ff;">'complexType'</span><span style="color: #339933;">,</span>					<span style="color: #666666; font-style: italic;">//Type Class (Complex)</span>
    	<span style="color: #0000ff;">'array'</span><span style="color: #339933;">,</span>						<span style="color: #666666; font-style: italic;">//Php Type (Array)</span>
    	<span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>								<span style="color: #666666; font-style: italic;">//Compistor??</span>
    	<span style="color: #0000ff;">'SOAP-ENC:Array'</span><span style="color: #339933;">,</span>				<span style="color: #666666; font-style: italic;">//Restriction Base</span>
    	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    		<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ref'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'SOAP-ENC:arrayType'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wsdl:arrayType'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'tns:basicBookingDetails[]'</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">//link back to complexType via namespace</span>
    		<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    	<span style="color: #0000ff;">'tns:basicBookingDetails'</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
    <span style="color: #666666; font-style: italic;">//Define Web Service</span>
    <span style="color: #000088;">$server</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">register</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ws_retrieveBasicBookingDetailsList'</span><span style="color: #339933;">,</span>
    	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'history'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'xsd:int'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>											<span style="color: #666666; font-style: italic;">//Input Parameters (Integer: Days)</span>
    	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'return'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'tns:arrBasicBookingDetails'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>						<span style="color: #666666; font-style: italic;">//Output Paraemters, an Array of BasicBookingDetails</span>
    		<span style="color: #0000ff;">'urn:villaQuoter.bookings'</span><span style="color: #339933;">,</span>											<span style="color: #666666; font-style: italic;">//Namespace</span>
	        <span style="color: #0000ff;">'urn:villaQuoter.bookings#ws_retrieveBasicBookingDetailsList'</span><span style="color: #339933;">,</span>   	<span style="color: #666666; font-style: italic;">//soapaction</span>
    		<span style="color: #0000ff;">'document'</span><span style="color: #339933;">,</span>																<span style="color: #666666; font-style: italic;">//style  rpc or document</span>
    		<span style="color: #0000ff;">'literal'</span><span style="color: #339933;">,</span>															<span style="color: #666666; font-style: italic;">//use encoded or literal</span>
    		<span style="color: #0000ff;">'This method returns basic details for bookings / quotes, define number of days of history to return. 0 = future only.'</span>	<span style="color: #666666; font-style: italic;">//documentation	</span>
    	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> ws_retrieveBasicBookingDetailsList<span style="color: #009900;">&#40;</span><span style="color: #000088;">$days</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span><span style="color: #666666; font-style: italic;">// Called by Web Service of Same Name.</span>
    	<span style="color: #000088;">$link</span><span style="color: #339933;">=</span><span style="color: #990000;">mysqli_connect</span><span style="color: #009900;">&#40;</span>DB_HOST<span style="color: #339933;">,</span> DB_USER<span style="color: #339933;">,</span> DB_PASSWORD<span style="color: #339933;">,</span> DB_NAME<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysqli_connect_errno</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    	<span style="color: #009900;">&#123;</span>	
    		<span style="color: #666666; font-style: italic;">//Raise SOAP Fault if Database Connection fails</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">new</span> soap_fault<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SQL-ERROR: '</span><span style="color: #339933;">.</span><span style="color: #990000;">mysqli_connect_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
		<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$link</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;call sr_RetrieveBasicBookingDetailsList(&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$days</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysqli_errno</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$link</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>	
    		<span style="color: #666666; font-style: italic;">//Raise SOAP Fault if Stored Routine Call Fails</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">new</span> soap_fault<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SQL-ERROR: '</span><span style="color: #339933;">.</span><span style="color: #990000;">mysqli_error</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$link</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
		<span style="color: #666666; font-style: italic;">//Create bookings array (holds multiple bookings of STRUCT Type basicBookingDetails	</span>
		<span style="color: #000088;">$bookings</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
		<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysqli_fetch_row</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span><span style="color: #666666; font-style: italic;">// Loop throu each booking and Load into 'bookings' array</span>
			<span style="color: #000088;">$booking</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	 			bookingRef <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
	 			customerId <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
	 			customerFullName <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
	 			state <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
	 			startDate <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
	 			endDate <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
	 			bookingDate <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
	 			totalCost <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>		
	 			amountOwing <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#93;</span>
			<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  		<span style="color: #000088;">$bookings</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$booking</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #666666; font-style: italic;">//Close Database Connection (results now in $bookings array)</span>
		<span style="color: #990000;">mysqli_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$link</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$bookings</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
    <span style="color: #000088;">$HTTP_RAW_POST_DATA</span> <span style="color: #339933;">=</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$HTTP_RAW_POST_DATA</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$HTTP_RAW_POST_DATA</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$server</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">service</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$HTTP_RAW_POST_DATA</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bizzie.biz/2011/08/php-webservice-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful commands on a MAC</title>
		<link>http://www.bizzie.biz/2011/05/useful-commands-on-a-mac/</link>
		<comments>http://www.bizzie.biz/2011/05/useful-commands-on-a-mac/#comments</comments>
		<pubDate>Fri, 06 May 2011 17:50:26 +0000</pubDate>
		<dc:creator>rob.langley@bizzie.biz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Mac OSx]]></category>

		<guid isPermaLink="false">http://localhost/?p=9</guid>
		<description><![CDATA[Below are a few commands I need to use on an adhoc basis, they are blogged here mainly for my own personal reference, but my help others To restart apache from the command line type sudo httpd -restart To view &#8230; <a href="http://www.bizzie.biz/2011/05/useful-commands-on-a-mac/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Below are a few commands I need to use on an adhoc basis, they are blogged here mainly for my own personal reference, but my help others</p>
<p>To restart apache from the command line type</p>
<blockquote><p>sudo httpd -restart</p></blockquote>
<p>To view network settings including IP address, MAC address, DNS etc from the command line (terminal) type</p>
<blockquote><p>ifconfig</p></blockquote>
<h2>Changing MAC Address</h2>
<p>Occasionally I have the need to temporally change my MAC address.  The following command achieves this.  However in order for this to be successful the order of events are important.  The steps assume you are using WiFi as opposed to a cabled ethernet, thou I suspect the process is very similar.</p>
<ul>
<li>Turn you WiFi off</li>
<li>Disable &#8216;Auto Join&#8217;</li>
<li>Re-enable WiFi.</li>
<li>Once the appropriate WiFi connection is detected type the following before before joining the network. (choose the required mac address)</li>
</ul>
<blockquote><p>sudo ifconfig en1 ether 1a:12:61:ff:aa:91</p></blockquote>
<ul>
<li>Type the following to verify the new MAC address.</li>
</ul>
<blockquote><p>ifconfig</p></blockquote>
<ul>
<li>Join the appropriate Network</li>
</ul>
<h2>Re-index Spotlight</h2>
<p>On occasion my spotlight index appear to have become corrupted and results are no longer returned.</p>
<p>Turn indexing on, on the root folder.</p>
<blockquote><p>sudo mdutil -i on /</p></blockquote>
<p>Rebuild index</p>
<blockquote><p>sudo mdutil -E /</p></blockquote>
<h2>Showing Hidden Files in Finder</h2>
<p>On occasion you need to view hidden files, I recently needed this when search for filezilla.xml in order to copy my config between machines.</p>
<p>To view hidden files</p>
<blockquote><p>defaults write com.apple.Finder AppleShowAllFiles TRUE</p>
<p>killall Finder</p></blockquote>
<p>To re-hide hidden files</p>
<blockquote><p>defaults write com.apple.Finder AppleShowAllFiles FALSE</p>
<p>killall Finder</p></blockquote>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bizzie.biz/2011/05/useful-commands-on-a-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTC Wildfire, Android and Address Book Syncing</title>
		<link>http://www.bizzie.biz/2011/05/htc-wildfire-android-and-address-book-syncing/</link>
		<comments>http://www.bizzie.biz/2011/05/htc-wildfire-android-and-address-book-syncing/#comments</comments>
		<pubDate>Sun, 01 May 2011 08:12:41 +0000</pubDate>
		<dc:creator>rob.langley@bizzie.biz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://www.bizzie.biz/?p=187</guid>
		<description><![CDATA[A few days a go my parents decided to ditch their 20th century phones and took a trip to a high street phone shop to purchase a new &#8216;smart&#8217; phone.  After visiting them last night I discovered they thought it &#8230; <a href="http://www.bizzie.biz/2011/05/htc-wildfire-android-and-address-book-syncing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A few days a go my parents decided to ditch their 20th century phones and took a trip to a high street phone shop to purchase a new &#8216;smart&#8217; phone.  After visiting them last night I discovered they thought it was far from smart.  With various issues they have so far spent 2 hours in the shop, 2 hours on telephone support fortunately this was to a freephone number.</p>
<h2>Address Book Issues</h2>
<p><img class="alignright size-full wp-image-192" title="Yahoo mail on Android HTC Wildfire" src="http://www.bizzie.biz/wp-content/uploads/2011/05/yahoo-mail-android-app-199x300.jpg" alt="Using Yahoo Mail on HTC Wildfire with Android" width="199" height="300" /><br />
So last night I was tasked with sorting their address book.  On the phone they appeared to have many contacts duplicated, they accepted this as some had come from the original phone sim and some from there Yahoo email address book.  But they were getting increasingly frustrated as they just could not seem to reliably delete and merge them.  They would delete a contact and a short while later it would be back again.  Then other contacts would appear in the &#8216;HTC People&#8217; list but on clicking Menu and Delete they were not listed and so could not be deleted.   Being an iPhone user and not familiar with Android I spent a further 2 frustrating hours trying to resolve this  before finally getting to the bottom of this.</p>
<p>I discovered a few things.</p>
<ol>
<li>The shop assistant had copied there SIM contact to the HTC Wildfire phone</li>
<li>The shop assistant also installed and setup Yahoo mail on from the Android store.</li>
<li>The telephone support people had set up HTC Sync and sync these phone contacts to Windows Contacts.</li>
<li>All contacts are shown in HTC People, but it does not seem obvious where they came from eg SIM, Windows Contacts or Yahoo.</li>
<li>When you try and delete a contact on the phone that originated from Yahoo contacts, these are not displayed, this can be frustrating when you can&#8217;t work out why you can not delete certain contacts.</li>
<li>If you delete a phone contact that is also in Windows Contacts it is not deleted from Windows Contacts and can in some cases syncs back to the phone.  arghhhh.</li>
</ol>
<p>So after working out how it all seemed to work, we decided we only need one master list and all contacts should be maintained from this list.  This could either be Windows Contacts or Yahoo Mail as they already used Yahoo mail it made sense to use this as the master for their HTC Wildfire phone.  So we did the following.</p>
<ol>
<li>Ensured any contacts that were on the phone / in windows contacts where also in Yahoo Mail or were not needed.</li>
<li>Deleted all contacts from Windows Contacts on the PC, Sync&#8217;ed the changes with HTC Sync and observed that these individual contacts were removed from HTC People.</li>
<li>Connect USB cable but select &#8216;Charge Only&#8217; on HTC screen NOT HTC Sync</li>
<li>Disabled &#8216;Contact Sync&#8217;ing&#8217; in Yahoo Mail / Menu / Options / [email account].  Acknowledge the warning about the contacts will be deleted from phone.  At this point there were now only a hand full of default contacts and groups on the phone.</li>
<li>Re-enabled Yahoo Mail &#8216;Contact Sync&#8217; and observed that the contacts appeared in the HTC People list after about 1 hour.</li>
</ol>
<p>With Yahoo Mail now as thier master address book they find it much simpler editing the address lists in an environment they are familiar with and the contacts &#8216;magically&#8217; appear on the phone.  It is important to realise the Sync is done over the wire and not OTA (over the air).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bizzie.biz/2011/05/htc-wildfire-android-and-address-book-syncing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scripting the addition of a new DNS Server entry</title>
		<link>http://www.bizzie.biz/2011/04/scripting-the-addition-of-a-new-dns-server-entry/</link>
		<comments>http://www.bizzie.biz/2011/04/scripting-the-addition-of-a-new-dns-server-entry/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 17:14:33 +0000</pubDate>
		<dc:creator>rob.langley@bizzie.biz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DNS]]></category>

		<guid isPermaLink="false">http://www.bizzie.biz/?p=169</guid>
		<description><![CDATA[I&#8217;m currently migrating a number of Virtual Machines between hosts and also to a new Active Directory domain.  For various reasons the DNS entries are manually configured as opposed to using DHCP.  One thing I found myself doing was manually &#8230; <a href="http://www.bizzie.biz/2011/04/scripting-the-addition-of-a-new-dns-server-entry/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently migrating a number of Virtual Machines between hosts and also to a new Active Directory domain.  For various reasons the DNS entries are manually configured as opposed to using DHCP.  One thing I found myself doing was manually adding the new DNS entries so the machines could resolve names in an alternate domain that has no trusts at a AD level.  I had already written a simple script to copy on some basic command line utilities such as grep and awk as well add various groups to the Remote Desktop Group.  However I found myself manually adding the new DNS server to the IP settings.</p>
<p>However after a quick Google I found the following useful command &#8216;netsh&#8217; where 10.1.1.26 is the IP address of the server you want to add.</p>
<blockquote><p>netsh interface ip add dns &#8220;Local Area Network&#8221; 10.1.1.26</p></blockquote>
<p>By default it adds this server to the end of the DNS server list so you not need to worry about over writing other entries. However you can specify the position by adding index=x where x is the position.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bizzie.biz/2011/04/scripting-the-addition-of-a-new-dns-server-entry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress needs to access your webserver</title>
		<link>http://www.bizzie.biz/2011/03/wordpress-needs-to-access-your-webserver/</link>
		<comments>http://www.bizzie.biz/2011/03/wordpress-needs-to-access-your-webserver/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 05:53:39 +0000</pubDate>
		<dc:creator>rob.langley@bizzie.biz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Mac OSx]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.bizzie.biz/?p=240</guid>
		<description><![CDATA[I have been working with WordPress for a few months now, and have been developing my sites on my MacBook Pro whilst traveling to work on the train. I have apache running and using a combination of host file entries &#8230; <a href="http://www.bizzie.biz/2011/03/wordpress-needs-to-access-your-webserver/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bizzie.biz/wp-content/uploads/2011/05/wordpressFtpUploadError.png"><img class="alignleft size-medium wp-image-241" title="Connection Error Installing WordPress Plugin" src="http://www.bizzie.biz/wp-content/uploads/2011/05/wordpressFtpUploadError-300x151.png" alt="The error you may get when trying to install a WordPress plugin running natively on Mac OSx" width="300" height="151" /></a>I have been working with WordPress for a few months now, and have been developing my sites on my MacBook Pro whilst traveling to work on the train.</p>
<p>I have apache running and using a combination of host file entries and apaches virtual hosts file I can have a number of sites running from my laptop for development purposes.  My main issue has been installing plugins and upgrading wordpress, when ever I tried to do this I found I got prompted for FTP details.  I was never quite sure why it need my ftp details as I was sure my live installations have no record of the actual ftp security credentials, yet they work fine.  So after several sessions on Google I found the <a title="Why WordPress Asks for Connection Info" href="http://http://www.chrisabernethy.com/why-wordpress-asks-connection-info/" target="_blank">excellent article</a> by Chris Abernethy explaining why wordpress needs this.  It turns out the fileowner of the WordPress website files need to be the same as the account that apache is running under.  In the case of Mac OSx 10.6.7 this user is _www</p>
<p>So by opening a terminal window and navigating to my &#8216;Sites&#8217; folder I could set the owner for the specific website concerned.</p>
<blockquote><p>sudo chown -R _www websiteFolder</p></blockquote>
<p>Now my plugin&#8217;s install via the GUI in the same way they do on my live production servers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bizzie.biz/2011/03/wordpress-needs-to-access-your-webserver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

