<?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>gHacks Technology News &#124; Latest Tech News, Software And Tutorials &#187; php</title> <atom:link href="http://www.ghacks.net/tag/php/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Fri, 10 Feb 2012 13:29:21 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>Learn How To Use MySQL Online</title><link>http://www.ghacks.net/2011/11/28/learn-how-to-use-mysql-online/</link> <comments>http://www.ghacks.net/2011/11/28/learn-how-to-use-mysql-online/#comments</comments> <pubDate>Mon, 28 Nov 2011 10:29:57 +0000</pubDate> <dc:creator>Martin Brinkmann</dc:creator> <category><![CDATA[Online Services]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[mysql database]]></category> <category><![CDATA[php]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=53281</guid> <description><![CDATA[Most webmasters have started to learn HTML before they moved on to programming languages such as PHP. With PHP come databases like MySQL as the primary storage for project data. Many popular online applications, such as WordPress, use the PHP and MySQL combination to power sites online. You usually do not need to know PHP [...]]]></description> <content:encoded><![CDATA[<p>Most webmasters have started to learn HTML before they moved on to programming languages such as PHP. With PHP come databases like MySQL as the primary storage for project data. Many popular online applications, such as WordPress, use the PHP and MySQL combination to power sites online.</p><p>You usually do not need to know PHP or MySQL if you download and install an application like WordPress. But if you want to start developing your own applications, or modifying existing ones, then you need to know the ins and outs of SQL database commands.</p><p>Head first SQL: Hands On is a free service by <a
href="http://headfirstlabs.com/sql_hands_on/hf01.htm">O&#8217;Reilly</a> that can be used to learn and execute MySQL queries online. when you open the Head First Labs site for the first time you see a form near the top that you can use to run MySQL commands.</p><p>The service provides access to several tables that are listed above the form. All you need to do is to enter a SQL query in the form to execute it. The core benefit of testing SQL commands here is that you do not have to create your own database first and fill it with data. Plus, you cannot really damage the database or tables this way.</p><p><a
href="http://www.ghacks.net/wp-content/uploads/2011/11/learn-how-to-use-mysql.jpg"><img
class="alignnone size-full wp-image-53282" title="learn how to use mysql" src="http://www.ghacks.net/wp-content/uploads/2011/11/learn-how-to-use-mysql.jpg" alt="learn how to use mysql" width="529" height="412" /></a></p><p>The results are displayed right beneath the for.  But the site offers more than just an option to run your own MySQL queries, which is especially useful for users who are just getting started and do not know anything about SQL.</p><p>The Get Started section of the page lists 33 MySQL lessons. The majority of lessons teach a specific command or command sets. This ranges from basic queries such as SELECT or INSERT to more complex operations. Not all lessons make sense, which can be attributed that some require that you have read the Head First SQL: Hands On book.</p><p>Some on the other hand can be used without having the book in reach. MySQL beginners will probably like the form on the start page the most, as it allows them to run custom SQL queries on sample database tables.</p><p>&nbsp;</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2011/11/28/learn-how-to-use-mysql-online/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Set up the Perfect Wiki on a Windows PC</title><link>http://www.ghacks.net/2011/07/24/set-up-the-perfect-wiki-on-a-windows-pc/</link> <comments>http://www.ghacks.net/2011/07/24/set-up-the-perfect-wiki-on-a-windows-pc/#comments</comments> <pubDate>Sun, 24 Jul 2011 14:21:27 +0000</pubDate> <dc:creator>Melanie Gross</dc:creator> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[easyphp]]></category> <category><![CDATA[php]]></category> <category><![CDATA[wiki]]></category> <category><![CDATA[wikipedia]]></category> <category><![CDATA[windows pc]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=48181</guid> <description><![CDATA[Most people know that a wiki is an internet-based environment for writers to collaborate and create articles that are easily linked. Media Wiki can be set up quickly with a fast installation. This covers all of the administrative tips and the PHP file insertions. Customize a Desktop design to use with applications and take it [...]]]></description> <content:encoded><![CDATA[<p>Most people know that a wiki is an internet-based environment for writers to collaborate and create articles that are easily linked.  Media Wiki can be set up quickly with a fast installation.  This covers all of the administrative tips and the PHP file insertions. Customize a Desktop design to use with applications and take it from there.</p><p>Easy PHP covers all of the installations necessary.  Visit their website, as they take the credit for this.  There is no need to set up an apache server, SQL database, or PHP 5.</p><p>You will find the download here: <a
href="http://www.easyphp.org/">http://www.easyphp.org/</a>. You will most likely face security warnings because this does involve many program files.  Set a restore point and backup files before proceeding.  The program will begin running automatically.</p><p>This is the desktop icon for version 5.3.6.1. Check the Administration page.  This page will display when a working web-server is running.</p><blockquote><p>MediaWiki is a free software open source wiki package written in PHP, originally for use on Wikipedia. It is now used by several other projects of the non-profit Wikimedia Foundation and by many other wikis, including this website, the home of MediaWiki.</p></blockquote><p>Extract <a
href="http://www.mediawiki.org/wiki/MediaWiki">Media Wiki</a> using 7-Zip under the “www” folder.  The folder will be displayed by EasyPHP in the Administration page. EasyPHP deploys MediaWiki at this point.  Under the Root icon, you can find the MediaWiki homepage.  Click the icon and the installation wizard will take it from there.  If you have disabled the Wizard, re-enable it.</p><p>Enable all image uploads if you need to place images. The wizard will create a file titled LocalSettings.php.  MediaWiki offers a complete manual to guide you through personal settings.  Place this file in the MediaWiki file created earlier.  MonoBook comes with MediaWiki and will give you plenty of theme options for the Wiki you want to create.</p><p>This next page contains the important user links: “long in/create account,” “edit,” and “Special Pages.”  Secure the Wiki by adding the following command to the LocalSettings.php file:</p><blockquote><p>$wgGroupPermissions['*']['edit'] = false;</p></blockquote><p>Go to the edit tab and experiment to learn about what you can do with this.  Assign a new account by clicking the link in the upper right corner to create a new user account.</p><p><img
src="http://www.ghacks.net/wp-content/uploads/2011/07/local-wiki.png" alt="local wiki" title="local wiki" width="450" height="262" class="alignnone size-full wp-image-48182" /></p><p>You can use the Special pages link in the other area of the window to create access to various administrative tools for your customized Wiki.</p><p>This is a basic set-up and files can be adapted to create preferences for user access.  It is a versatile system but it takes some learning.  Navigate the options and use the tutorial offered in order to get an overview of the myriad settings you can customize to your specifications.  There is a User Import Extension to adapt to user networks and allow other users to utilize this tool for creating Wiki text and images.  This can be downloaded under the Extensions folder.  Use this for easy Wiki creations.  Once you learn the options, this is simple to use for ongoing needs.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2011/07/24/set-up-the-perfect-wiki-on-a-windows-pc/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Typo3 Winstaller, Windows Typo3 Environment</title><link>http://www.ghacks.net/2011/01/31/typo3-winstaller-windows-typo3-environment/</link> <comments>http://www.ghacks.net/2011/01/31/typo3-winstaller-windows-typo3-environment/#comments</comments> <pubDate>Mon, 31 Jan 2011 09:57:35 +0000</pubDate> <dc:creator>Martin Brinkmann</dc:creator> <category><![CDATA[The Web]]></category> <category><![CDATA[Windows]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[php]]></category> <category><![CDATA[typ3 windows]]></category> <category><![CDATA[typo3]]></category> <category><![CDATA[typo3 winstaller]]></category> <category><![CDATA[wamp]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=39448</guid> <description><![CDATA[Typo3 is a powerful Open Source content management system that runs on system that support recent versions of PHP and MySQL. Linux users usually do not have a problem installing PHP and MySQL on their systems, while Windows users may have troubles finding a solution to run them on their system. Typo3 Winstaller is a [...]]]></description> <content:encoded><![CDATA[<p>Typo3 is a powerful Open Source content management system that runs on system that support recent versions of PHP and MySQL. Linux users usually do not have a problem installing PHP and MySQL on their systems, while Windows users may have troubles finding a solution to run them on their system.</p><p>Typo3 Winstaller is a free WAMP (which means Windows, Apache, MySQL and PHP) webserver that comes preinstalled with the Typo3 content manangement system. It basically offers everything needed to get started eliminating the need to install and configure the dependencies individually.</p><p>The installer sets up a full Typo3 environment on the system that can be used immediately without configuration. This can be helpful for developers, students, employees and everyone else who wants or needs to work with Typo3.</p><p><strong>The main features of Typo3 Winstaller</strong></p><ul><li>Download and Play &#8211; no configuration and no other manually intervention is required</li><li>simple user interface</li><li>includes preconfigured Quickstart, Testsite and Dummy packages of TYPO3 (demo pages)</li><li>easy to try the full functionality of the CMS TYPO3</li><li>TYPO3Winstaller runs from portable hardware (i.e. MemorySticks) and from CD/DVD</li></ul><p>The package is offered as a zip file and executable. The executable handles the unpacking for the user, the remaining process remains the same.</p><p>The application offers a basic control panel that displays information about running services (Apache, MySQL), options, logs and the ability to start and stop the Typo3 content management system.</p><p><a
href="http://www.ghacks.net/wp-content/uploads/2011/01/typo3winstaller.jpg"><img
src="http://www.ghacks.net/wp-content/uploads/2011/01/typo3winstaller.jpg" alt="typo3winstaller" title="typo3winstaller" width="502" height="254" class="alignnone size-full wp-image-39451" /></a></p><p>Typo3 runs on the local system. The control panel launches the web interface in the default browser after installation or manual activation. This is at the same time the final test that everything is up and running.</p><p><a
href="http://www.ghacks.net/wp-content/uploads/2011/01/typo3-winstaller.jpg"><img
src="http://www.ghacks.net/wp-content/uploads/2011/01/typo3-winstaller-550x400.jpg" alt="typo3 winstaller" title="typo3 winstaller" width="550" height="400" class="alignnone size-medium wp-image-39452" /></a></p><p>The welcome page links to several Typo3 related resources which is handy for beginners who want to learn Typo3.</p><p>Interested users can download Typo3 <a
href="http://typo3winstaller.sourceforge.net/?home">Winstaller</a> from its project page over at Sourceforge.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2011/01/31/typo3-winstaller-windows-typo3-environment/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Manage your VirtualBox VMs via the web with phpVirtualBox</title><link>http://www.ghacks.net/2011/01/27/manage-your-virtualbox-vms-via-the-web-with-phpvirtualbox/</link> <comments>http://www.ghacks.net/2011/01/27/manage-your-virtualbox-vms-via-the-web-with-phpvirtualbox/#comments</comments> <pubDate>Thu, 27 Jan 2011 01:03:30 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[The Web]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[php]]></category> <category><![CDATA[virtual-machine]]></category> <category><![CDATA[virtualbox]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=39332</guid> <description><![CDATA[Generally speaking, if it is a web-based tool that starts with &#8220;php&#8221; (such as phpMyAdmin or phpLDAPadmin) you know that tool is going to make your administrative life a lot easier. Such is the case with a php-based tool created to help you manage all of your VirutalBox VMs from a single tool, from anywhere [...]]]></description> <content:encoded><![CDATA[<p>Generally speaking, if it is a web-based tool that starts with &#8220;php&#8221; (such as phpMyAdmin or phpLDAPadmin) you know that tool is going to make your administrative life a lot easier. Such is the case with a php-based tool created to help you manage all of your VirutalBox VMs from a single tool, from anywhere (so long as said &#8220;anywhere&#8221; is accessible from, you guessed it, anywhere).</p><p>I do use VirtualBox and was thrilled to come across <a
title="phpVirtualBox" href="http://code.google.com/p/phpvirtualbox/" target="_blank">phpVirtualBox</a>. This tool is an AJAX implementation of the familiar VirtualBox user interface, so the minute you log in you will be instantly at home. Let&#8217;s take a look at how this tool is installed and used.</p><p><span
id="more-39332"></span><strong>First things first</strong></p><p>You need to make sure you have the latest VirtualBox installed as well as the Extension Pack. You can run phpVirtualBox with the 3.x release of VirtualBox, but there are a lot more features available in the 4.x release. You can download both from the VirtualBox <a
title="VirtualBox downloads" href="http://www.virtualbox.org/wiki/Downloads" target="_blank">download page</a>. You will also need to have the PHP Soap extension. This can be installed by searching for the package php-soap in your Add/Remove Software tool. Once you have that installed, you are then ready to install and configure the phpVirtualBox application.</p><p>You will also have to have a working Apache server on the target machine. If you do not have that, you can go ahead and do a full LAMP install (which will cover a lot of your basics).</p><p><strong>Installing phpVirtualBox</strong></p><p>First download the compressed installation file from the <a
title="downloads" href="http://code.google.com/p/phpvirtualbox/downloads/list" target="_blank">download page</a>. Make sure you download the release that is correct for the version of VirtualBox you have installed. What you need to do is to move that file into your web server&#8217;s document root and then unpack it. When you unpack the file you will have a newly created directory <strong>/var/www/phpvirtualbox-XXX </strong>Where XXX is the release number. I highly recommend you rename that directory to just <strong>/var/www/phpvirtualbox</strong>.</p><p>After you have the file unpacked, you need to do a minor configuration. This minor configuration is in the <strong>/var/www/phpvirtualbox/config.php</strong>. NOTE: Depending upon your distribution, your document root will differ.</p><p>You really only need configure the following options:</p><ul><li>var $username</li><li>var $password</li></ul><p>Make sure the username and password are for the user that will actually run the virtualbox application (so this won&#8217;t be a root user).</p><p>You are now ready to fire up daemon. To run this simply issue the command <em>vboxwebsrv</em>. This will run the daemon that will allow you to log into your phpvitualbox machine. NOTE: If you are using VirtualBox 4.x you can start the daemon with the command <em>/etc/init.d/vbweb-service</em>. There is one catch with that, you still want to run the web service as the user that will run VirtualBox.</p><p><strong>Log in</strong></p><p>Open up a browser and point it to http://ADDRESS_TO_SERVER/phpvirtualbox. When you do this you will see the VirtualBox interface embedded into your web browser. You can then use VirtualBox from within that web browser as if it were on the local machine!</p><p><strong>Gotcha</strong></p><p>If you are running VirtualBox 3.x you will need to take one other step (prior to starting up the daemon). Open up your terminal window and issue the command:</p><p><code>VBoxManage setproperty websrvauthlibrary null</code></p><p>Once that command has run, you can then start up the daemon and use VirtualBox through your webbrowser.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2011/01/27/manage-your-virtualbox-vms-via-the-web-with-phpvirtualbox/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Incredibly simple MySQL administration with SQL Buddy</title><link>http://www.ghacks.net/2011/01/12/incredibly-simple-mysql-administration-with-sql-buddy/</link> <comments>http://www.ghacks.net/2011/01/12/incredibly-simple-mysql-administration-with-sql-buddy/#comments</comments> <pubDate>Wed, 12 Jan 2011 21:52:27 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[database]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[php]]></category> <category><![CDATA[phpmyadmin]]></category> <category><![CDATA[ubuntu]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=38925</guid> <description><![CDATA[If you have a need to manage MySQL databases, you know that learning the syntax for the various MySQL tools can be a real nightmare. Fortunately there are tools out there that make this job far more easy. But of the web-based tools, which are easiest? You might have given phpMyAdmin a try, but found [...]]]></description> <content:encoded><![CDATA[<p>If you have a need to manage MySQL databases, you know that learning the syntax for the various MySQL tools can be a real nightmare. Fortunately there are tools out there that make this job far more easy. But of the web-based tools, which are easiest? You might have given phpMyAdmin a try, but found it a bit complex to get up and running (if you&#8217;re curious about phpMyAdmin, read my article &#8220;<a
href="http://www.ghacks.net/2008/12/20/install-phpmyadmin-for-easy-mysql-administration/" target="_blank">Install phpmyadmin for easy MySQL administration</a>&#8220;). If that is the case, and you&#8217;re still looking for an easy way to manage your MySQL databases, look no further than <a
href="http://www.sqlbuddy.com/" target="_blank">SQL Buddy</a>.</p><p>SQL Buddy is one of the easiest web-based admin tools you will ever find. Not only does it make the process of creating and editing MySQL databases easy, it is also incredibly easy to install. Let&#8217;s see just how easy this is to manage.</p><p><span
id="more-38925"></span><strong>What you need</strong></p><p>You will, of course, need a working installation of MySQL. You will also have to have your MySQL admin user and password handy. As far as dependencies, you will need to have the following installed:</p><ul><li>PHP &gt;= 4.3</li><li>MySQL &gt;= 4</li></ul><p>Of course, if you already have the MySQL server up and running you might only need the PHP piece installed. You can install the PHP dependency easily from your Add/Remove Software tool. Search for &#8220;php&#8221; (no quotes) and install the version recommended for your distribution and release.</p><p>You will also need to download the SQL Buddy file. You can find that from the <a
href="http://www.sqlbuddy.com/" target="_blank">SQL Buddy main page</a>. This file will be a .zip file. Save that file into your web server&#8217;s document root (on a Ubuntu machine that would be <strong>/var/www</strong>).</p><p><strong>Installation</strong></p><div
id="attachment_38926" class="wp-caption alignleft" style="width: 340px"><a
href="http://www.ghacks.net/wp-content/uploads/2011/01/sql_buddy.png"><img
class="size-medium wp-image-38926 " src="http://www.ghacks.net/wp-content/uploads/2011/01/sql_buddy-550x371.png" alt="" width="330" height="223" /></a><p
class="wp-caption-text">Figure 1</p></div><p>You will be shocked to know there really is no installation. All you need to do is unzip the sqlbuddy_XXX.zip (Where XXX is the release number) within your web server document root and then point your browser to http://ADDRESS_TO_SERVER/sqlbuddy. Where ADDRESS_TO_SERVER is the actual address of your MySQL server. When you do this you will be prompted for the MySQL admin credentials. Enter the credentials and, upon successful authentication, you will find yourself on the SQL Buddy main page (see Figure 1).</p><div
id="attachment_38927" class="wp-caption alignright" style="width: 340px"><a
href="http://www.ghacks.net/wp-content/uploads/2011/01/sql_buddy_table.png"><img
class="size-medium wp-image-38927 " src="http://www.ghacks.net/wp-content/uploads/2011/01/sql_buddy_table-550x444.png" alt="" width="330" height="266" /></a><p
class="wp-caption-text">Figure 2</p></div><p>Once you are in you will find the interface very simple to use. Here you can create new databases by entering a name for the database, selecting the correct charset (Very important), and hitting Submit. Once you do that you will find yourself at a new screen. This new screen (Figure 2) allows you to edit the database and create tables for the database.</p><p>You do need to pay close attention to the creation of tables for your database. Make sure you add the correct fields for the the table or you will get an SQL error and the table will not be saved.</p><p>After you successfully enter the data for your tables, click Submit and your table will be added to the new Database (and the database will be successfully saved).</p><p><strong>Final thoughts</strong></p><p>If you have been searching for an easy method to manage your MySQL databases, search no more&#8230;SQL Buddy will have you easily creating and managing databases on your MySQL server.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2011/01/12/incredibly-simple-mysql-administration-with-sql-buddy/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Weezo, Remote Access And Web Server For Windows</title><link>http://www.ghacks.net/2010/07/01/weezo-remote-access-and-web-server-for-windows/</link> <comments>http://www.ghacks.net/2010/07/01/weezo-remote-access-and-web-server-for-windows/#comments</comments> <pubDate>Thu, 01 Jul 2010 17:09:33 +0000</pubDate> <dc:creator>Martin Brinkmann</dc:creator> <category><![CDATA[Software]]></category> <category><![CDATA[Windows]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[local server]]></category> <category><![CDATA[php]]></category> <category><![CDATA[remote server]]></category> <category><![CDATA[remote-access]]></category> <category><![CDATA[web server]]></category> <category><![CDATA[weezo]]></category> <category><![CDATA[windows server]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=27774</guid> <description><![CDATA[Weezo is remote access made easy. The server comes as a portable version or installer for the Windows operating system. It basically allows a user to configure remote access to files on a computer system and to run scripts on a web server at the same time. Here is how it works. Weezo will run [...]]]></description> <content:encoded><![CDATA[<p>Weezo is remote access made easy. The server comes as a portable version or installer for the Windows operating system. It basically allows a user to configure remote access to files on a computer system and to run scripts on a web server at the same time.</p><p>Here is how it works. Weezo will run a configuration script on the first startup. The script will start the core services and perform connection checks to ensure that the server is accessible from a local network and the Internet.</p><p><span
id="more-27774"></span><div
id="attachment_27775" class="wp-caption alignnone" style="width: 510px"><img
src="http://www.ghacks.net/wp-content/uploads/2010/07/weezo-500x341.png" alt="weezo" title="weezo" width="500" height="341" class="size-medium wp-image-27775" /><p
class="wp-caption-text">weezo</p></div></p><p>A free Weezo account can be created during setup of the server. The account offers the advantage that a permanent url is associated with it which can be used to access the server. This is similar to a service that offers a permanent domain name for dynamic IPs. It is possible to use the program anonymously, but this means that users connected to the computer need the right IP address to do so.</p><p>The Weezo server interface is then started on the computer, providing the means to configure the the shared contents and users as well as core configuration options and an activity monitor that displays information about logged in users and server status changes.</p><p>All resorts around user groups and resources. Groups are used to allow or block access to resources. The administrator for instance has access to all resources by default while the public group does not.</p><p>Groups are protected with passwords and can be further protected by adding allowed IPs. Options to provide a distinct website theme, sounds and sticky notes are provided as well.</p><p>Resources are the core of the server. Here it is possible to enable file access and sharing, blog and websites, communication modules like chat or webcam, bookmarks, web TV, a web proxy routing traffic through the Weezo website and additional modules.</p><p>Some interesting resources are the following:</p><ul><li>Photos Album: Share photos with anyone connecting to the server.</li><li>Music and Videos: Listen to music or watch videos remotely, great for sharing music and videos with friends.</li><li>RSS Reader, bookmarks: Access and share RSS feeds and bookmarks easily wherever you are</li></ul><div
id="attachment_27777" class="wp-caption alignnone" style="width: 510px"><img
src="http://www.ghacks.net/wp-content/uploads/2010/07/share-files-500x375.jpg" alt="share files" title="share files" width="500" height="375" class="size-medium wp-image-27777" /><p
class="wp-caption-text">music player</p></div><p>One click install / download options are provided for popular web scripts such as WordPress, Joomla or phpBB even though they are not always offered in the latest version. MySQL can be installed as well as it is a requirement for several of the scripts.</p><div
id="attachment_27776" class="wp-caption alignnone" style="width: 510px"><img
src="http://www.ghacks.net/wp-content/uploads/2010/07/remote-access-server-500x395.jpg" alt="remote access server" title="remote access server" width="500" height="395" class="size-medium wp-image-27776" /><p
class="wp-caption-text">remote access server</p></div><p>Some modules were not completely translated into English, only offered in French. WordPress for instance was available in French. It was however no problem to change the configuration files on the local system to change the language to English. This is also the way to update scripts to their latest versions.</p><p>Admins have direct access to MySQL, phpMyAdmin, the Apache configuration and pretty much every other server configuration file. Helpful for instance to import a database or make modifications to the remote server.</p><p>Ports can be changed in the configuration, the default port is 80. It is furthermore possible to use a secure connection (SSL) to connect to the server.</p><p><strong>Screenshots:</strong></p><div
id="attachment_27778" class="wp-caption alignnone" style="width: 510px"><img
src="http://www.ghacks.net/wp-content/uploads/2010/07/remote-access-server1-500x395.jpg" alt="remote access server" title="remote access server" width="500" height="395" class="size-medium wp-image-27778" /><p
class="wp-caption-text">remote access server</p></div><div
id="attachment_27779" class="wp-caption alignnone" style="width: 510px"><img
src="http://www.ghacks.net/wp-content/uploads/2010/07/remote-desktop-500x375.jpg" alt="remote desktop" title="remote desktop" width="500" height="375" class="size-medium wp-image-27779" /><p
class="wp-caption-text">remote desktop</p></div><div
id="attachment_27780" class="wp-caption alignnone" style="width: 510px"><img
src="http://www.ghacks.net/wp-content/uploads/2010/07/remote-file-explorer-500x375.jpg" alt="remote file explorer" title="remote file explorer" width="500" height="375" class="size-medium wp-image-27780" /><p
class="wp-caption-text">remote file explorer</p></div><div
id="attachment_27781" class="wp-caption alignnone" style="width: 510px"><img
src="http://www.ghacks.net/wp-content/uploads/2010/07/rss-feed-sharing-500x375.jpg" alt="rss feed sharing" title="rss feed sharing" width="500" height="375" class="size-medium wp-image-27781" /><p
class="wp-caption-text">rss feed sharing</p></div><div
id="attachment_27782" class="wp-caption alignnone" style="width: 510px"><img
src="http://www.ghacks.net/wp-content/uploads/2010/07/server-login-500x375.jpg" alt="server login" title="server login" width="500" height="375" class="size-medium wp-image-27782" /><p
class="wp-caption-text">server login</p></div><p>Weezo offers a one-click installation server for web scripts, file sharing and remote file access. It provides rights management and an easy to understand admin interface that can be used to configure most, but not all, of the options of the server.</p><p>Some operations require manual configuration changes, which definitely will be a problem for inexperienced users. There is for instance no option to update WordPress to the latest version from within the admin interface.</p><p><a
href="http://www.weezo.net/content/view/45/66/lang,en/">Weezo</a> is available for download at the developer&#8217;s website.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/07/01/weezo-remote-access-and-web-server-for-windows/feed/</wfw:commentRss> <slash:comments>11</slash:comments> </item> <item><title>How to install eGroupware</title><link>http://www.ghacks.net/2010/04/11/how-to-install-egroupware/</link> <comments>http://www.ghacks.net/2010/04/11/how-to-install-egroupware/#comments</comments> <pubDate>Sun, 11 Apr 2010 00:30:14 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Advanced]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[CRM]]></category> <category><![CDATA[egroupware]]></category> <category><![CDATA[ERP]]></category> <category><![CDATA[groupware]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[Pear]]></category> <category><![CDATA[php]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=24325</guid> <description><![CDATA[Quite some time ago I wrote an article that illustrated how eGroupware could serve as a legitimate Exchange replacement (see my article &#8220;eGroupware: Your Exchange replacement has arrived&#8220;). I very briefly skimmed over the process of installing this outstanding groupware tool. In this case, skimming will get you nowhere. Recently I revisited the installation of [...]]]></description> <content:encoded><![CDATA[<p>Quite some time ago I wrote an article that illustrated how eGroupware could serve as a legitimate Exchange replacement (see my article &#8220;<a
title="eGroupware: Your Exchange replacement has arrived" href="http://www.ghacks.net/2009/01/21/egroupware-your-exchange-replacement-has-arrived/" target="_blank">eGroupware: Your Exchange replacement has arrived</a>&#8220;). I very briefly skimmed over the process of installing this outstanding groupware tool. In this case, skimming will get you nowhere.</p><p>Recently I revisited the installation of eGroupware and thought I should give a bit more detail on the procedure of installing this rather challenging tool. So in this article I will walk you through the steps on installing eGroupware.</p><p><span
id="more-24325"></span><strong>Download and unpack and prerequisites<br
/> </strong></p><p>I will assume you have a working Apache and MySQL installation, on your Linux server,  ready to go. If not, go ahead and take care of that major prerequisite first. Once you have completed that task you are ready to being. Almost. There are still a few other prerequisites to get out of the way. You will want to fire up Synaptic (or whatever package manager you use) and make sure you have the following installed:</p><ul><li>PHP</li><li>php-pear</li><li>An SMTP server (Postfix is a good choice)</li><li>IMAP server (Dovecot is a good choice)</li></ul><p>There will also be a LOT of pear extensions to install &#8211; we will deal with those in a moment. Before going any further create the database you intend on using (let&#8217;s stick with the name egroupware). If you&#8217;re not sure how to create the database give my article &#8220;<a
title="MySQL Workbench" href="http://www.ghacks.net/2009/12/25/complete-database-administration-package-mysql-workbench/" target="_blank">Complete database administration with MySQL Workbench</a>&#8221; a read.</p><p>Now it&#8217;s time. move the the downloaded tar file for eGroupware into the <strong>/var/www/</strong> directory and then unpack it with the commands:</p><p><em>bunzip2 eGroupware-XXX.tar.bz2 </em></p><p>Where XXX is the release number.</p><p><em>tar xvzf eGroupware-XXX.tar</em></p><p>Where XXX is the release number.</p><p>You will now have a newly created directory <strong>/var/www/egroupware</strong>. Point your browser to <em>http://ADDRESS_TO_SERVER/egroupware</em> and you will begin the installation process. This is where it gets fun. On the first page you will have a link that allows you to run the installation tests. Click that and you will be presented with a long list of items. Each of these items will be preceded by either a green check, a yellow lightning bolt, or a red X. Anything marked with a red X MUST be resolved. Yellow lightning bolts are only warnings. Some of these you can ignore (for instance features you know you won&#8217;t use). The green checks &#8211; those are all right.</p><p>Most likely you will need to deal with some php issues and some Pear modules. Let&#8217;s examine each.</p><p><strong>PHP</strong></p><p>In the directory <strong>/etc/php5/apache2/ </strong>is the main php configuration file (<strong>php.ini</strong>). You will need to make some modifications to this file in order for the installation to work. Typically the modifications you will need to deal with are:</p><p><strong>upload_max_filesize &gt;= 8M </strong>By default PHP has a 2MB upload limit. You will need to change that.</p><p><strong>mbstring.func_overload = 7 </strong>By default this is set to 0. You will need to change this.</p><p><strong>Pear</strong></p><p>Now you will enjoy quite a few pear module installations. This is hit or miss on how many your system will have installed by default. What you need is the following:</p><ul><li>HTTP_WebDAV_Server</li><li>Net_Socket</li><li>Auth_SASL</li><li>Net_IMAP</li><li>Net_Sieve</li><li>XML_Feed_Parser</li><li>Log</li></ul><p>Some of these modules can be found in Synaptic. The best way to locate them is do a search for &#8220;pear&#8221; (No quotes) and then mark the necessary modules for installation (and then, of course, install them). Those that you do not find you will have to install from the command line, like so:</p><p><em>sudo pear install MODULE_NAME</em></p><p>Typically these install very quickly.</p><p>You should now be at the point where all of the X&#8217;s are gone and all of the necessary warnings have been replaced with green checks as well. The next step is to click Continue with the Header Admin. That we will deal with in our next article.</p><p><strong>Final thoughts</strong></p><p>It may seem like eGroupware is a pain to install. It&#8217;s not really as bad as some I have tried to work with. But it is, most certainly, worth the effort.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/04/11/how-to-install-egroupware/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Enable mod_rewrite in a Ubuntu server</title><link>http://www.ghacks.net/2009/12/05/enable-mod_rewrite-in-a-ubuntu-server/</link> <comments>http://www.ghacks.net/2009/12/05/enable-mod_rewrite-in-a-ubuntu-server/#comments</comments> <pubDate>Sat, 05 Dec 2009 21:00:12 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[The Web]]></category> <category><![CDATA[Tutorials Advanced]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[mod_rewrite]]></category> <category><![CDATA[php]]></category> <category><![CDATA[rewrite engine]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=21080</guid> <description><![CDATA[If you have done much work with Apache then most likely you have experienced a need for enabling the rewrite engine. If you are unfamiliar with the rewrite engine, you can think of it as a means for your web server to literally rewrite urls so they are easier for users to remember. So instead [...]]]></description> <content:encoded><![CDATA[<p>If you have done much work with Apache then most likely you have experienced a need for enabling the rewrite engine. If you are unfamiliar with the rewrite engine, you can think of it as a means for your web server to literally rewrite urls so they are easier for users to remember. So instead of having to enter:</p><p>http://192.168.1.100/rewrite.php?link=1</p><p>Your users would only have to type:</p><p>http://192.168.1.100/link2.html</p><p>Of course the rewrite engine serves as much more than just a means for your users to more easily remember addresses. Many server softwares (such as the social networking server <a
title="Elgg" href="http://www.elgg.org" target="_blank">Elgg</a>) depending upon the rewrite engine in order to function. Because of this, the rewrite engine is almost a necessity to have working. By default Apache does not have the rewrite engine on, so you have to configure it to work. The goal of this tutorial is to show you how to enable the rewrite engine in a Ubuntu server installation. This article will assume you already have your Ubuntu server as well as Apache up and running.</p><p><span
id="more-21080"></span></p><p><strong>What this involves</strong></p><p>In order to get the rewrite engine working for your web site you will have to take care of the following steps:</p><ol><li>Instruct Apache to load the <em>mod_rewrite </em>module.</li><li>Edit the document root entry so that the rewrite engine is allowed.</li><li>Create an <em>.htaccess </em> file to rewrite urls for you.</li></ol><p><strong>Creating a simple test</strong></p><p>Before we get to the actual configuration, the first thing to do is to set up a little rewrite test. Open up a terminal window (or log into your GUI-less server) and change to the <strong>/var/www</strong> directory. In that directory create a file, named <em>rewrite.php,</em> with the <a
title="Contents of the test page" href="http://pastebin.com/f1d68c8c1" target="_blank">following contents</a>. NOTE: Code is located on pastebin.com for ease of use.</p><p>Copy and paste the contents of that file into your <em>rewrite.php<strong> </strong><span
style="font-style: normal">file. If you visit that page, in a browser, without the rewrite engine working, you will quickly see that it will not work. So, let&#8217;s get rewrite working.</span></em></p><p><em><span
style="font-style: normal">Now you will have to create an <strong>.htaccess </strong>file in the <strong>/var/www/</strong> directory with the following contents:</span></em></p><p><code>RewriteEngine On<br
/> RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L]</code></p><p><em><span
style="font-style: normal"><strong>Enabling the module</strong></span></em></p><p>In order to enable the <em>mod_rewrite</em> module in the Ubuntu server issue the following command:</p><p><em>sudo a2enmod rewrite</em></p><p>The above Apache2 Enable Module command will add the correct line in the <strong>/etc/apache2/apache2.conf </strong>file. That is the only change you need to make with the <strong>apache2.conf <span
style="font-weight: normal">file. Now it&#8217;s time to make a change to the document root. </span></strong></p><p>In older versions of Apache all virtual host directory directives were managed in the <strong>/etc/apache2/apache2.conf<span
style="font-weight: normal"> file. This has changed. Now these alterations are handled within the </span>/etc/apache2/sites-enabled/<span
style="font-weight: normal"> directory. Within that directory you will find, by default, a single file called </span>000-default<span
style="font-weight: normal">. </span> </strong>If you open that file up for editing you will see, at the top, the two sections you need to edit in order to enable the rewrite engine for the document root of your Apache server.</p><p>First look in the <em>&lt;Directory /&gt; </em>section and change the line:</p><p><em>AllowOverride None</em></p><p>to</p><p><em>AllowOverride All</em></p><p>Do the same for the <em>&lt;Directory /var/www/&gt; </em>section.</p><p>Once you have the file edited, restart Apache with the command:</p><p><em>sudo /etc/init.d/apache2 restart</em></p><p>Now revisit the <em>rewrite.php</em> page in your browser and you should see that rewriting is now working. Congratulations, you have just taken on step forward in opening up an entire world for your Apache needs.</p><p><strong>Final thoughts</strong></p><p>The rewrite engine is used by so many web-based tools. Upon installation of Apache, this should be one of the first tasks you tackle.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/12/05/enable-mod_rewrite-in-a-ubuntu-server/feed/</wfw:commentRss> <slash:comments>16</slash:comments> </item> <item><title>Apache troubleshooting tips</title><link>http://www.ghacks.net/2009/11/08/apache-troubleshooting-tips/</link> <comments>http://www.ghacks.net/2009/11/08/apache-troubleshooting-tips/#comments</comments> <pubDate>Sun, 08 Nov 2009 00:21:57 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Networks]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[The Web]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[apache log]]></category> <category><![CDATA[apache2]]></category> <category><![CDATA[apache2ctl]]></category> <category><![CDATA[log files]]></category> <category><![CDATA[php]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=18266</guid> <description><![CDATA[How many times have you installed a LAMP server only to find Apache doesn&#8217;t seem to want to run right? Or you install a new module only to see Apache try to download pages as file, instead of displaying them on screen? There are a hundred and one thousand things that can go wrong with [...]]]></description> <content:encoded><![CDATA[<p>How many times have you installed a LAMP server only to find Apache doesn&#8217;t seem to want to run right? Or you install a new module only to see Apache try to download pages as file, instead of displaying them on screen?</p><p>There are a hundred and one thousand things that can go wrong with any web server installation. From a fresh installation to an installation that has been running for a long time, you never know when something is going to cause your web server to go astray. When it does happen, it&#8217;s always nice to know that, usually, Occam&#8217;s Razor applies.</p><p>In this tutorial you will find some advice that will help you through some of the more common issues that can pop up with an Apache web server.</p><p><span
id="more-18266"></span><strong>Is your server actually running?</strong></p><p>Believe it or not, this has happened to plenty of administrators. You take the server down, do some maintenance, and when you go to check out the server you&#8217;re getting errors. The first thing you do, naturally, is check out that <strong>/etc/apache2/apache.conf</strong> file to make sure your syntax is correct. But it&#8217;s perfect! What&#8217;s up? The first thing you might want to check is to make sure the server is running. But you don&#8217;t want to just issue the command to start the server or reload the server. Instead, issue the command:</p><p><em>sudo /etc/init.d/apache2 status</em></p><p>Which should return something like:</p><p><em>* apache is running (pid 9751).</em></p><p>If not, start the server with either:</p><p><em>sudo /etc/init.d/apache2 start</em></p><p>or</p><p><em>sudo apache2ctl start</em></p><p>NOTE: If you are using a distribution like Fedora, SuSE, or Mandriva you will need to first <em>su </em>to the root user and issue the above commands WITHOUT using <em>sudo</em>.</p><p><strong>It&#8217;s not running and it won&#8217;t start</strong></p><p>Did you just make changes to your Apache configuration file? Are the changes correct? If you&#8217;re not sure, you can use the <em>apache2ctl </em>command to check the syntax of your configuration file. This is done with the command:</p><p><em>sudo apache2ctl configtext</em></p><p><em><span
style="font-style: normal">The above command should report:</span></em></p><p><em><span
style="font-style: normal">Syntax OK</span></em></p><p><em><strong><span
style="font-style: normal"><span
style="font-weight: normal">If you don&#8217;t get an OK, you will get information that points to the errors in your configuration file. </span></span></strong></em></p><p><em><strong><span
style="font-style: normal"><span
style="font-weight: normal"><strong>Apache wants to download .php files!</strong></span></span></strong></em></p><p><em><strong><span
style="font-style: normal"><span
style="font-weight: normal"><strong><span
style="font-weight: normal">This is another common issue. When you add a new tool on your web server (such as Drupal), if your configuration file is set up properly, any .php file might not be displayed. Instead any attempt to view a .php file will instead have your browser trying to download the file. Why is this? Apache must be informed that certain extensions are to be displayed, not downloaded. This is done from within the Apache configuration file. Open up that file (in the Ubuntu server it will be </span>/etc/apache2/apache2.conf<span
style="font-weight: normal">) and first look for the following line:</span></strong></span></span></strong></em></p><p><em><strong><span
style="font-weight: normal"><strong><span
style="font-weight: normal">DirectoryIndex index.html</span></strong></span></strong></em></p><p>If that file doesn&#8217;t include <em>index.php </em>nearly all sites that use php will be rendered useless.</p><p>The second line to look for is:</p><p><em>AddHandler application/x-httpd-php .php</em></p><p>If you find this line, and it is commented out, make sure you uncomment it by removing the &#8220;#&#8221; character. If it is not there add it to the bottom of the configuration file.</p><p>And, as always, when you make a change to the configuration file, restart Apache.</p><p><strong>Know where to look for problems</strong></p><p>Finally, it is crucial that you know where to first turn when the above doesn&#8217;t help you out. Any time I have an issue with Apache where Occam&#8217;s Razor does not apply, the first place I turn is the log files.</p><p>If you look in <strong>/var/log/apache2</strong> you will find, at least, the following files:</p><ul><li><span
style="background-color: #ffffff">access.log: This keeps track of any connection made to your server.</span></li><li><span
style="background-color: #ffffff">error.log: This keeps track of any errors that occur with Apache.</span></li><li><span
style="background-color: #ffffff">other_vhosts_access.log: This is where virtual hosts will log when the virtual host has not been prescribed its own log file.</span></li></ul><p>Of course, as your site evolves so will your available log files. Regardless of what you find in <strong>/var/log/apache2</strong>, that is where you should always first turn when you have problems. Even before you google.</p><p><strong>Final thoughts</strong></p><p>Now you should be able to handle some of the more common issues with the Apache server. And if your problem isn&#8217;t common, you also know where to turn to find clues that will lead you down the right path to correction.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/11/08/apache-troubleshooting-tips/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Local Apache Web Server Wampserver</title><link>http://www.ghacks.net/2009/09/17/local-apache-web-server-wampserver/</link> <comments>http://www.ghacks.net/2009/09/17/local-apache-web-server-wampserver/#comments</comments> <pubDate>Thu, 17 Sep 2009 09:08:17 +0000</pubDate> <dc:creator>Martin Brinkmann</dc:creator> <category><![CDATA[Open Source]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Windows]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[apache server]]></category> <category><![CDATA[apache web server]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[php]]></category> <category><![CDATA[wampserver]]></category> <category><![CDATA[webmaster]]></category> <category><![CDATA[xampp]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=16430</guid> <description><![CDATA[Running a local Apache web server is essential for many webmasters. It is always a good idea to test code locally before publishing it on the Internet. Professional webmasters usually test their code in a local web server before it gets published. Mainly to avoid possible downtimes in the live environment but also to avoid [...]]]></description> <content:encoded><![CDATA[<p>Running a local Apache web server is essential for many webmasters. It is always a good idea to test code locally before publishing it on the Internet. Professional webmasters usually test their code in a local web server before it gets published. Mainly to avoid possible downtimes in the live environment but also to avoid the hassle of having to upload and edit code on the Internet or network. It&#8217;s simply faster to test everything locally.</p><p>Wampserver is an Apache web server for the Windows operating system. It provides in many regards the same functionality of other web server solutions like <a
href="http://www.ghacks.net/2007/01/31/host-your-own-webserver/">XAMPP</a> or <a
href="http://www.ghacks.net/2009/03/28/home-web-server/">Home Web Server</a> which we have reviewed in the past. The latest version of the local web server package will install Apache 2.2.11, MySQL 5.1.36 and PHP 5.3.0 on the local computer system.</p><p><span
id="more-16430"></span>One interesting unique feature is the ability to add different versions of Apache, MySQL and PHP to the installation in the form of add-ons. This can be very handy to test a website locally under multiple different Apache, MySQL or PHP release versions.</p><p><img
src="http://www.ghacks.net/wp-content/uploads/2009/09/apache_web_server.gif" alt="apache web server" title="apache web server" width="281" height="289" class="alignnone size-full wp-image-16431" /></p><p>The installation of Wampserver will always install the latest versions of Apache, MySQL and PHP. One interesting security feature is the ability to limit access to the web server to localhost. It is required to click on the &#8220;put online&#8221; option to make it available to other computer systems as well.</p><p>Additional Apache, MySQL and PHP versions can be installed from the Wamp add-ons <a
href="http://www.wampserver.com/en/add-ons.php">page</a>. All add-ons are provided as executables that can be installed easily on the operating system.</p><p>Webmasters who need to test code offline can use Wampserver to do so. It is especially useful to test code against multiple versions of Apache, MySQL and PHP. Something that the other home server solutions do not provide.</p><p><a
href="http://www.wampserver.com/en/">Wampserver</a> is Open Source and can be downloaded from the developer&#8217;s website.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/09/17/local-apache-web-server-wampserver/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>How to: Install a LAMP server</title><link>http://www.ghacks.net/2009/07/23/how-to-install-a-lamp-server/</link> <comments>http://www.ghacks.net/2009/07/23/how-to-install-a-lamp-server/#comments</comments> <pubDate>Thu, 23 Jul 2009 17:43:55 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Networks]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[LAMP]]></category> <category><![CDATA[lamp server]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[php]]></category> <category><![CDATA[tasksel]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=14678</guid> <description><![CDATA[If you&#8217;ve read enough of my Ghacks tutorials you have most likely come across mention of a LAMP server. If you are not sure what a LAMP server is: Linux Apache MySQL P (can mean PHP or PERL &#8211; depends upon your needs) LAMP servers are very popular, cheap, effective, flexible, and reliable servers. But [...]]]></description> <content:encoded><![CDATA[<p>If you&#8217;ve read enough of my Ghacks tutorials you have most likely come across mention of a LAMP server. If you are not sure what a LAMP server is:</p><ul><li>Linux</li><li>Apache</li><li>MySQL</li><li>P (can mean PHP or PERL &#8211; depends upon your needs)</li></ul><p>LAMP servers are very popular, cheap, effective, flexible, and reliable servers. But how are they installed? Actually, it&#8217;s not that hard. In this tutorial I am going to show you how to install a LAMP in two different ways: From the command line (using separate tools) and using the <em>tasksel</em> tool.</p><p><span
id="more-14678"></span><strong>Hardware needed</strong></p><p>Fortunately a LAMP server can be installed on lower-end hardware and still serve as a fairly efficient server. Naturally if you are going to be using your LAMP server for high traffic, you will want to select your hardware wisely.</p><p><strong>Install prerequisite</strong></p><p>Before you begin the installation of your server you will need to have your operating system installed. This is the &#8220;L&#8221; of LAMP. So find your favorite Linux distribution and install the operating system. For the purposes of this installation I am going to be installing on a Ubuntu 9.04 server installation. This will be a console only server (no GUI desktop) which is fine because the installation is done via command line only.</p><p>Once you have your operating system installed you are ready to install your server.</p><p><strong>Apache</strong></p><p>This is the easiest portion to install. Either log in to your console or open up a terminal window (if you are working from a GUI desktop) and enter the following command:<br
/> <code>sudo apt-get install apache2</code></p><p>You will have to enter your sudo user password for this installation to continue. Once this installation is complete check it by pointing a browser to that server IP address. You should instantly know if Apache is up and running.</p><p><strong>PHP</strong></p><p>For the purposes of this article we will assume the &#8220;P&#8221; stands for PHP. To install PHP (and all of its requirements) issue the command:</p><p><code>sudo apt-get install php5 libapache2-mod-php5</code></p><p>Once this installation is complete restart Apache with the command:</p><p><code>sudo /etc/init.d/apache2 restart</code></p><p>Let&#8217;s make sure this portion works properly. To test this create a file in the Apache document root (for this install it will be <strong>/var/www</strong>) called test.php. The contents of this file will be:<br
/> <code>&lt; ?php phpinfo(); ?&gt;</code></p><p>Save that file and then point your browser to http://IP_ADDRESS/test.php</p><p>Where IP_ADDRESS is the actual IP address of your server.</p><p>You should see &#8220;Test PHP Page&#8221; written on your browsers page. If so, you&#8217;re good to go.</p><p><strong>MySQL</strong></p><p>Now to install MySQL. To do this issue the command:</p><p><code>sudo apt-get install mysql-server</code></p><p>Once this is done you then need to set a password for MySQL. To do this issue the command:</p><p><code>mysql -u root</code></p><p>which will put you in the MySQL prompt. From this prompt (which looks like <em>mysql&gt; </em>) enter the command:<br
/> <code>SET PASSWORD FOR 'root'@'localhost' = PASSWORD('YOURPASSWORD');</code></p><p>Where YOURPASSWORD is the password you want to use for the mysql user.</p><p>Now start your MySQL server with the command:</p><p><code>/etc/init.d/mysql start</code></p><p>That&#8217;s it. Your LAMP server is up and running.</p><p><strong>The quick version</strong></p><p>You can actually install a full-on LAMP server on a (Ubuntu server install) with a single command:</p><p><code>sudo tasksel</code></p><p>You will need to select LAMP from the list and you will eventually be prompted for a MySQL password. That&#8217;s it.</p><p><strong>Final thoughts</strong></p><p>Getting a powerful, flexible web server up and running will take you less time and effort than you think. LAMP servers are an outstanding choice for your web servers&#8217; needs.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/07/23/how-to-install-a-lamp-server/feed/</wfw:commentRss> <slash:comments>16</slash:comments> </item> <item><title>How To Display Valid Markup Code In Websites</title><link>http://www.ghacks.net/2009/05/07/how-to-display-valid-markup-code-in-websites/</link> <comments>http://www.ghacks.net/2009/05/07/how-to-display-valid-markup-code-in-websites/#comments</comments> <pubDate>Thu, 07 May 2009 13:19:48 +0000</pubDate> <dc:creator>Martin Brinkmann</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[code]]></category> <category><![CDATA[html]]></category> <category><![CDATA[html entities]]></category> <category><![CDATA[html entities converter]]></category> <category><![CDATA[markup code]]></category> <category><![CDATA[php]]></category> <category><![CDATA[valid code]]></category> <category><![CDATA[w3c]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=12644</guid> <description><![CDATA[There are two difficulties or problems that Internet users encounter when they want to paste code into forms to display these on the Internet. The first problem that can be encountered is that the website will interpret part or all of the code instead of displaying it. A basic example would be to display the [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://www.ghacks.net/wp-content/uploads/2009/05/w3c.jpg" alt="w3c" title="w3c" width="100" height="86" class="alignleft size-full wp-image-12647" />There are two difficulties or problems that Internet users encounter when they want to paste code into forms to display these on the Internet. The first problem that can be encountered is that the website will interpret part or all of the code instead of displaying it. A basic example would be to display the html code needed to make text linkable on a website. These codes are interpreted by most forms automatically if the user just pastes the code into the form. The second problem that can arise is that the website will not validate because of the way it has been pasted into the form. Displaying the &amp; char will for example return an error when validating the code. This can lead to all kinds of troubles including broken RSS feeds (read: <a
href="http://www.ghacks.net/2009/04/14/internet-explorer-8-and-feeds-the-xml-page-cannot-be-displayed/">The XML Feed Cannot Be Displayed</a>).</p><p><span
id="more-12644"></span>Displaying valid markup code in websites, forums, blogs and any other page is not difficulty. The only thing that needs to be done to achieve this is to convert all entities before pasting the code. This can be done manually or by using a script like that offered at <a
href="http://www.spacefem.com/tutorials/makecode.php">Spacefem</a>.</p><p>All that needs to be done is to paste the code into the form and click on the Make Code button at the bottom. To display the following code on a website</p><p><code>&lt;a href=&quot;http://www.ghacks.net/&quot;&gt;Ghacks&lt;/a&gt;</code></p><p>one would have to paste the following code into the form on the website where the code should be displayed</p><p><code>&amp;lt;a href=&amp;quot;http://www.ghacks.net/&amp;quot;&amp;gt;Ghacks&amp;lt;/a&amp;gt;</code></p><p><img
src="http://www.ghacks.net/wp-content/uploads/2009/05/html_entities_converter-500x273.jpg" alt="html entities converter" title="html entities converter" width="500" height="273" class="alignnone size-medium wp-image-12646" /></p><p>This is actually the easiest way to ensure that the website will not interpret the code and that the code will be valid markup code.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/05/07/how-to-display-valid-markup-code-in-websites/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Display Cached RSS Feed In Your Website</title><link>http://www.ghacks.net/2009/05/06/display-cached-rss-feed-in-your-website/</link> <comments>http://www.ghacks.net/2009/05/06/display-cached-rss-feed-in-your-website/#comments</comments> <pubDate>Wed, 06 May 2009 11:44:23 +0000</pubDate> <dc:creator>Martin Brinkmann</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[php]]></category> <category><![CDATA[rss feed]]></category> <category><![CDATA[simplepie]]></category> <category><![CDATA[web dev]]></category> <category><![CDATA[web development]]></category> <category><![CDATA[websites]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=12615</guid> <description><![CDATA[You might remember the announcement of our new web project Appnews which basically displays software updates in a friendly easily accessible way. What I wanted to do now is to display the five newest items of the RSS feed in the sidebar of this blog to both promote the appnews service but also provide a [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://www.ghacks.net/wp-content/uploads/2009/05/rss.jpg" alt="rss" title="rss" width="128" height="128" class="alignleft size-full wp-image-12614" />You might remember the announcement of our new web project <a
href="http://appnews.net/">Appnews</a> which basically displays software updates in a friendly easily accessible way. What I wanted to do now is to display the five newest items of the RSS feed in the sidebar of this blog to both promote the appnews service but also provide a new service to my readers as they would be able to see the software updates immediately in the sidebar. What I needed was a high traffic friendly way of displaying the RSS feed and that meant caching. Without caching the script would request the contents on every page hit which would slow down the web server tremendously.</p><p><span
id="more-12615"></span>One of the better scripts to display cached RSS feeds in a website is SimplePie. It might look a bit intimidating at first glance as it provides lots of options to customize the display. It is however very easy to display a feed with just a few lines of code. Start by downloading <a
href="http://simplepie.org/">SimplePie</a> from the website. Extract it to the computer system and upload it to the root folder of the website. You should also create a directory called <em>cache</em> in that root folder and make it writeable (chmod to 777).</p><p>Now add the following two lines to the top of the php file where you want to display the feed in. The first line defines the location of the simplepie.inc file on the web server (which is in the simplepie directory in root), the second the feed that you want to display on the website.</p><p><code>&lt;?php <br
/> include_once $_SERVER['DOCUMENT_ROOT'] . '/simplepie/simplepie.inc'; <br
/> $feed = new SimplePie('http://feedproxy.google.com/Ghacksnet');<br
/> ?&gt;</code></p><p>Now place the following code in the location on the website where the feed should be displayed. This will fetch the five newest feed items and display them in the selected location.</p><p><code>&lt;ul&gt;<br
/> &lt;?php foreach ($feed-&gt;get_items(0, 5) as $item): ?&gt;<br
/> &lt;li&gt;<br
/> &lt;a href=&quot;&lt;?php print $item-&gt;get_permalink(); ?&gt;&quot;&gt;<br
/> &lt;?php print $item-&gt;get_title(); ?&gt;&lt;/a&gt;<br
/> &lt;/li&gt;<br
/> &lt;?php endforeach; ?&gt;<br
/> &lt;/ul&gt;</code></p><p>And that&#8217;s it. SimplePie offers a wealth of additional functions and settings to display more than one feed or mix feeds. The default caching time is 60 minutes.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/05/06/display-cached-rss-feed-in-your-website/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>How to show 5 top categories in WordPress</title><link>http://www.ghacks.net/2009/04/09/how-to-show-5-top-categories-in-wordpress/</link> <comments>http://www.ghacks.net/2009/04/09/how-to-show-5-top-categories-in-wordpress/#comments</comments> <pubDate>Thu, 09 Apr 2009 10:02:44 +0000</pubDate> <dc:creator>Daniel Pataki</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[blog]]></category> <category><![CDATA[categories]]></category> <category><![CDATA[php]]></category> <category><![CDATA[web development]]></category> <category><![CDATA[wordpress]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=11827</guid> <description><![CDATA[WordPress is a great piece of software, and allows more than you&#8217;d think to be done with simple coding. I bet that a lot of people out there would look for a plugin to do this, but your top five categories can very easily be shown using a WordPress template tag, just a half a [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://www.ghacks.net/wp-content/uploads/2009/04/wordpress.png" alt="wordpress" title="wordpress" width="128" height="128" class="alignleft size-full wp-image-11834" />WordPress is a great piece of software, and allows more than you&#8217;d think to be done with simple coding. I bet that a lot of people out there would look for a plugin to do this, but your top five categories can very easily be shown using a WordPress template tag, just a half a line of code.</p><p>The tag we need is called &#8220;wp_list_categories()&#8221; and by default it lists all your categories in alphabetical order. All we need to do is add some arguments to it to modify the default values and we&#8217;re done! We need to limit the number of items shown to five, we also want to show the post counts in the categories and we want to order the list by the post count, in descending order.</p><p>The &#8220;number&#8221; argument actually has no default value. The reason for this is that it limits the SQL query directly, so there is no need for it by default. We can add it though to impose a limit, so our first argument will be &#8220;number=5&#8243;. We also want to show the post counts, so we use &#8220;show_count=1&#8243; to enable this (show_count=0 is the default).</p><p><span
id="more-11827"></span>We also want to order the list by the post count, so we use &#8220;orderby=count&#8221; to achieve this. By default lists are sorted ascending, meaning that the lowest post count would show up first. To make the list descending, we can use &#8220;order=DESC&#8221;.</p><p>I also use one last argument in there, which is &#8220;title_li=&#8221;. This sets the title of the list to be nothing, by default the list is presented with a title. I like to hard code my titles for a few reasons, but feel free to change this as you like. So here is the complete code I used, one simple line to do a seemingly hard task, enjoy</p><p>&lt;?php wp_list_categories(&#8216;number=5&amp;show_count=1&amp;orderby=count&amp;order=DESC&amp;title_li=&#8217;) ?&gt;</p><p><img
class="alignleft size-full wp-image-10878" src="http://www.ghacks.net/wp-content/uploads/2009/03/scrip_twitter.gif" alt="Script" width="53" height="53" /><strong>If you&#8217;d like to read some similar articles, take a look at <a
title="Web development blog" href="http://www.bluehost.com/cgi/suspended?d=scriptastique.com">Scriptastique</a>, a blog all about web development and coding, with great tips on CSS, HTML, PHP, MySQL and Javascript and tutorials and screencasts coming soon! You can follow us on our <a
title="Scriptastique RSS feed" href="http://feeds2.feedburner.com/scriptastique">RSS feed</a>, or <a
title="Scriptastique on Twitter" href="http://twitter.com/scriptastique">Twitter</a> where we&#8217;re posting 3-4 short tips daily now!</strong></p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/04/09/how-to-show-5-top-categories-in-wordpress/feed/</wfw:commentRss> <slash:comments>10</slash:comments> </item> <item><title>WordPress template tags you should know</title><link>http://www.ghacks.net/2009/03/29/wordpress-template-tags-you-should-know/</link> <comments>http://www.ghacks.net/2009/03/29/wordpress-template-tags-you-should-know/#comments</comments> <pubDate>Sun, 29 Mar 2009 14:41:55 +0000</pubDate> <dc:creator>Daniel Pataki</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[php]]></category> <category><![CDATA[template tags]]></category> <category><![CDATA[wordpress]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=11529</guid> <description><![CDATA[If you run a WordPress blog, you will eventually want to make some modifications to your theme. Perhaps you want to show your tags, not just categories, perhaps you want the date in a different format, you might want to add the URL of the author to each post, there are a lot of things [...]]]></description> <content:encoded><![CDATA[<p>If you run a WordPress blog, you will eventually want to make some modifications to your theme. Perhaps you want to show your tags, not just categories, perhaps you want the date in a different format, you might want to add the URL of the author to each post, there are a lot of things like that which can easily be done with a little knowledge of <a
title="wordpress tags" href="http://codex.wordpress.org/Template_Tags" target="_blank">WordPress template tags</a>, which are little PHP code snippets, but you don&#8217;t have to be a coder to use them.</p><p>The great thing about these tags is that they are very well documented &#8220;see link above&#8221;, and that they are extremely simple to use. You don&#8217;t need to know anything about PHP, so let me explain their basic use in common sense language. WordPress uses a loop, elegantly called &#8220;the loop&#8221; in &#8220;WordPressian&#8221;, which cycles through the posts you have.</p><p>If you show 10 posts on your main page, the loop cycles through the latest 10 posts. This means that one the first loop it will pull in the data of your latest post, on the second pass it will look at the second and so on. All the data is pulled, all you need to do is specify what you want to display out of that data, let&#8217;s take a look at how.</p><p><span
id="more-11529"></span></p><p>First of all, you need to identify the start and the end of the loop. The loop starts with the following (there may be some variation) :</p><p>&lt;?php if(have_posts()) : ?&gt;<br
/> &lt;?php while(have_posts()) : the_post(); ?&gt;</p><p>And ends with a &#8220;&lt;?php endwhile; ?&gt; &lt;?php endif; ?&gt;&#8221;. This end statement is usually followed by the page navigation links which let you &#8220;turn the page&#8221; to the next or previous posts. Anything inside the loop gets executed as many times as the number of posts which are shown.</p><p>If all you want is to show your title, you just need to put &#8220;&lt;?php the_title() ?&gt;&#8221;, and you will get the titles of your first 10 posts. If you also want to show the tags you can add &#8220;&lt;?php the_tags() ?&gt;&#8221;. There are many others you can add, and don&#8217;t forget, you also need some HTML and CSS to make them look good.</p><p>Here&#8217;s a list of the most basic ones and what they do, but you can see the full list and expanded usage by clicking on the link above. Remember that the following should be put in the form: &lt;?php function() ?&gt;</p><ul><li>the_title() &#8211; outputs the title of the</li><li>the_content() &#8211; displays the actual post body</li><li>the_category() &#8211; displays the categories the post is in</li><li>the_tags() &#8211; displays the tags for the post</li><li>the_author &#8211; outputs the post author&#8217;s name</li><li>the_author_url &#8211; outputs the link to the author&#8217;s page, used a lot in links with &#8220;the_author&#8221;</li><li>the_time() &#8211; outputs the time of the post, you need to add the format in the parenthesis</li><li>the_permalink &#8211; outputs the posts permalink, usually used in a link with &#8220;the_title&#8221;</li></ul><p>While I use many others now and again, there are loads of designs that only use these 8, you can do a lot, with these alone. As you can see, adding to and modifying a WordPress template is not such a big deal, why not try it yourself?</p><p><img
class="alignleft size-full wp-image-10878" src="http://www.ghacks.net/wp-content/uploads/2009/03/scrip_twitter.gif" alt="Script" width="53" height="53" /><strong>If you&#8217;d like to read some similar articles, take a look at <a
title="Web development blog" href="http://www.bluehost.com/cgi/suspended?d=scriptastique.com">Scriptastique</a>, a blog all about web development and coding, with great tips on CSS, HTML, PHP, MySQL and Javasctipt and tutorials and screencasts coming soon! You can follow us on our <a
title="Scriptastique RSS feed" href="http://feeds2.feedburner.com/scriptastique">RSS feed</a>, or <a
title="Scriptastique on Twitter" href="http://twitter.com/scriptastique">Twitter</a> and <a
title="Scriptastique on Facebook" href="http://www.facebook.com//login.php">Facebook</a>! </strong></p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/03/29/wordpress-template-tags-you-should-know/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>Creating a simple multi-lingual website</title><link>http://www.ghacks.net/2009/03/19/creating-a-simple-multi-lingual-website/</link> <comments>http://www.ghacks.net/2009/03/19/creating-a-simple-multi-lingual-website/#comments</comments> <pubDate>Thu, 19 Mar 2009 16:54:33 +0000</pubDate> <dc:creator>Daniel Pataki</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[languages]]></category> <category><![CDATA[php]]></category> <category><![CDATA[php constants]]></category> <category><![CDATA[translation]]></category> <guid
isPermaLink="false">http://www.ghacks.net/2009/03/19/creating-a-simple-multi-lingual-website/</guid> <description><![CDATA[If you want to create a simple webpage for yourself, listing who you are, how you can be contected and what you do, you might want to add a few languages in there. You could use Google Translate, but that does not yield the best (and professional) results, so it would be best to translate [...]]]></description> <content:encoded><![CDATA[<p>If you want to create a simple webpage for yourself, listing who you are, how you can be contected and what you do, you might want to add a few languages in there. You could use Google Translate, but that does not yield the best (and professional) results, so it would be best to translate the page yourself, or have someone do it for you.</p><p>Now, you could have different pages like &#8220;about_english.php&#8221; and &#8220;about_spanish.php&#8221;, but this would make updating a pain, and very inflexible, plus if you have 20 languages, it means 20 files per page. So how do we get around this? Let me introduce you guys, to PHP constants.</p><p>A constant is defined just like a variable, but as its name suggests, it is in fact constant. It can be echoed just like a variable, and is great for defining set pieces of text. Let me show you my method of using constants to easily keep multiple language versions of a webpage, without having to have multiple files for each page.</p><p><span
id="more-11335"></span></p><p>First of all, let&#8217;s take a look at how to define constants. Constant names are uppercase strings, but must not begin with a number and should not start with a special character. For example, let&#8217;s define a constant:</p><p>define(&#8220;NAME&#8221;, &#8220;Daniel Pataki&#8221;);</p><p>In this exampe we have defined a constant called &#8220;NAME&#8221;, and gave it a value of &#8220;Daniel Pataki&#8221;. I gave the constant a describing name, so I know that this constant holds my name.</p><p>The way I create multiple languages is that I create 1 language file for each language. I name them according to the standard 2 letter convention. The English file is named &#8220;en.php&#8221;, the French would be &#8220;fr.php&#8221; and so on. I include the language file the user needs at the beginning of all my other files containing text, so they will automatically be defined. There are many way to approach this, but for now, let&#8217;s say that the page is always in English, unless a user clicks one of the language links. So at the beginning of the code I would write:</p><p>&lt;?php<br
/> if (isset($_GET['lang']))<br
/> include($_GET['lang'].&#8221;.php&#8221;);<br
/> else<br
/> include(&#8220;en.php&#8221;)<br
/> ?&gt;</p><p>This way the relevant file will be included only. Each file contains the list of definitions I need in the same structure. My name in the English version is &#8220;Daniel Pataki&#8221;, but in Hungarian we put our family names in the front, so in &#8220;hu.php&#8221; I would define it as:</p><p>define(&#8220;NAME&#8221;, &#8220;Pataki Dániel&#8221;);</p><p>In the page&#8217;s code, I can then simply type the following to display my name:</p><p>&lt;h2&gt;&lt;?php echo NAME ?&gt;&lt;/h2&gt;</p><p>This would show my name as a level 2 heading. If the user is viewing in English, the output would be &#8220;Daniel Pataki&#8221;, if the user is viewing in Hungarian it would display &#8220;Pataki Dániel&#8221;, since this time &#8220;hu.php&#8221; is included, and not &#8220;en.php&#8221;. Notice that when displaying contants you do no need to put any special characters before or after the constant name, just type the constant itself as you defined it.</p><p>You can use this method to create languages for larger sites too. The reason I especially like this is that it is quite easy to translate the site, you just need to send the file over to someone and he will be able to do it easily, without any training. If you have a larger site it might be a good idea to indicate where the constant will be used. You can do this by defining a constant name like &#8220;SIDEBAR_COMMENTS&#8217;, or &#8220;CONTACT_NAME&#8221;. This way you and your translators will have an easier time, especially if you also use PHP comments in the language file for further pointers.</p><p>&lt;em&gt;If you liked this article, perhaps you&#8217;d like to take a look at &lt;a href=&#8221;http://scriptastique.com&#8221;&gt;Scriptastique&lt;/a&gt;, which is a blog (and upcoming tutorial site) aimed at professional and aspiring coders. We just started, but there are daily posts and the tutorials (along with screencasts) are on the way!&lt;/em&gt;</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/03/19/creating-a-simple-multi-lingual-website/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Web development roundup</title><link>http://www.ghacks.net/2009/03/16/web-development-roundup/</link> <comments>http://www.ghacks.net/2009/03/16/web-development-roundup/#comments</comments> <pubDate>Mon, 16 Mar 2009 17:31:05 +0000</pubDate> <dc:creator>Daniel Pataki</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[php]]></category> <category><![CDATA[web development]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=11272</guid> <description><![CDATA[Last week was a bit less active in web development terms, but here&#8217;s a roundup of what you can find on Scriptastique if you haven&#8217;t been taking a look recently. We had a look at how a mysql query basically works, which will come in handy if you&#8217;re just learning about MySQL and PHP. The [...]]]></description> <content:encoded><![CDATA[<p>Last week was a bit less active in web development terms, but here&#8217;s a roundup of what you can find on <a
href="http://www.bluehost.com/cgi/suspended?d=scriptastique.com">Scriptastique</a> if you haven&#8217;t been taking a look recently.</p><p>We had a look at how a mysql query basically works, which will come in handy if you&#8217;re just learning about MySQL and PHP. The article focuses more on the technical side than how to create specific queries, but we&#8217;ll get there in the end too! Just after that we created some simple but effective excerpts from longer text automatically removing unwanted characters and spaces.</p><p>We also had a look at website mascots, why you should use them, how to use arithmetic operators in PHP and just today, why a coder should always be well slept (easier said than done). If you feel like taking a stroll down web development avanue visit the site, or follow us on <a
href="http://twitter.com/scriptastique">Twitter</a> or our <a
href="http://feeds2.feedburner.com/scriptastique">RSS feed</a>!<br
/> <span
id="more-11272"></span></p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/03/16/web-development-roundup/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Identifying each page using body tags and CSS</title><link>http://www.ghacks.net/2009/03/11/identifying-each-page-using-body-tags-and-css/</link> <comments>http://www.ghacks.net/2009/03/11/identifying-each-page-using-body-tags-and-css/#comments</comments> <pubDate>Wed, 11 Mar 2009 18:00:51 +0000</pubDate> <dc:creator>Daniel Pataki</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[css]]></category> <category><![CDATA[php]]></category> <category><![CDATA[superglobal]]></category> <category><![CDATA[web development]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=11106</guid> <description><![CDATA[If you are building a large website, chances are you have a great little CSS stylesheet linked to every document which governs all the pages. But what do you do if you want just one of the pages to be completely different? You could of course go into your code and ad separate id-s and [...]]]></description> <content:encoded><![CDATA[<p>If you are building a large website, chances are you have a great little CSS stylesheet linked to every document which governs all the pages. But what do you do if you want just one of the pages to be completely different? You could of course go into your code and ad separate id-s and classes for specific elements, but I use a bit of an easier approach.</p><p>The basis of this is to use php code to determine the directory of the page you are viewing and also the page&#8217;s name itself. I will show you the code in a second, but let&#8217;s say you have a social network site underway and you keep you messaging system (outbox, inbox, new message, etc.) in a folder named &#8220;messaging&#8221;. In this case you can grab the name of the directory and the page and assign these as an id and a class to the body tag automatically, so it would look like this for the inbox: <em>&lt;body class=&#8221;messaging&#8221; id=&#8221;inbox&#8221;&gt;</em>.</p><p>This will make it very easy to add new rules in your stylesheet, since you can refer to whole documents in a directory using <strong>&#8220;body.messaging&#8221;</strong> and you can refer to specific pages using<strong> &#8220;body#inbox&#8221;</strong>. You can now use the same CSS file to change the look of only one page without the need to go in and add new classes and ids all the time. So how about the code to grab the directory and the page? Let&#8217;s take a look!</p><p><span
id="more-11106"></span></p><p>First of all, let&#8217;s determine the page. For this we will use the <strong>&#8220;$_SERVER&#8221;</strong> superglobal variable which stores a lot of valuable information about the page you are viewing, the IP viewing the page and so on. Here&#8217;s the code as is, with the explanation coming up afterward.</p><pre>function page()
{
$page = substr(strrchr($_SERVER['PHP_SELF'],'/'),1,-4);
return $page;
}</pre><p>As you can see this is a function because I use it a lot throughout the site, not just for this one purpose. <strong>&#8220;$_SERVER['PHP_SELF']&#8220;</strong> will return the path to the file with the filename from your root directory, so it will look something either like this: <strong>&#8220;/directory/subdirectory/file.php&#8221;</strong> or if the file is in the root directory it will simply be <strong>&#8220;/file.php&#8221;</strong>. To get only the filename we want to chop off all the bits before the slash (and the slash itself), and also chop off the file extension.</p><p>As you can see the first thing I did was to chop off everything before the last slash using <strong>&#8220;strrchr()&#8221;</strong> which returns the part of the string after the last occurrence of the sub-string you specify. However, the last slash still remains, but this is not a problem, we can get rid of this, and the &#8220;.php&#8221; part in one go.</p><p>This is done by using <strong>&#8220;substr()&#8221;</strong>. The function took three arguments, the string we want to work with, and two integers. The first integer tells the function to start from character 1 (this means everything before that will be chopped off, in this case character 0, which is the slash) and then return everything up to the -4th character from the end. This means that four characters will be dropped from the end.</p><p>Now the variable <strong>&#8220;$page&#8221;</strong> contains only the readable part of the filename which would be &#8220;inbox&#8221; or &#8220;index&#8221;, without any slashes or the extension. You could also create this as a variable without using function. the reason I use a function is that I usually have some extra code in there which allows me to echo the function at once by default, but also to store it as a variable if needed.</p><p>Now, let&#8217;s take a look at determining the directory. We could take the same approach as before but chop off different bits, but PHP already has a function which will make our life easier, let&#8217;s take a look at the code:</p><pre>function thedir()
{
$dir = substr(strrchr(getcwd(), '/'),1);
return $dir;
}</pre><p>Using <strong>&#8220;getcwd()&#8221;</strong> we can get the current working directory. This will be in the form of <strong>&#8220;/directory/subdirectory&#8221;</strong>, so all we need to do is return everything after the last slash and chop the last slash off. We use the same technique as before, so now we also have our directory. Once done, all you need to do is modify your header, which should be in a PHP file to make the body tag look like this (calling the functions as the names for the class and id):</p><pre>&lt;body id="&lt;?php echo page() ?&gt; class="&lt;?php echo $thedir ?&gt;""&gt;</pre><p>There are some other ways to do this, some can be simpler or more complicated, this is more like the proving of a point, but it is totally usable and I use a modified version of it throughout my sites. This is not a whole lot of code extra and will make your site better structured and easier to modify.</p><p>Please be aware that<strong> &#8220;getcwd()&#8221;</strong> can give you some weird results if you changed your current working directory somewhere in your code. In this case you can use a modified version of the &#8216;page getting&#8217; code, or you can take a look at the <a
href="http://hu.php.net/reserved.variables.server">server superglobal</a> section in the PHP manual for some more help.</p><p><img
class="alignleft size-full wp-image-10878" src="http://www.ghacks.net/wp-content/uploads/2009/03/scrip_twitter.gif" alt="Script" width="53" height="53" /><strong>If you&#8217;d like to read some similar articles, take a look at <a
title="Web development blog" href="http://www.bluehost.com/cgi/suspended?d=scriptastique.com">Scriptastique</a>, a blog all about web development and coding, with great tips on CSS, HTML, PHP, MySQL and Javasctipt and tutorials and screencasts coming soon! You can follow us on our <a
title="Scriptastique RSS feed" href="http://feeds2.feedburner.com/scriptastique">RSS feed</a>, or <a
title="Scriptastique on Twitter" href="http://twitter.com/scriptastique">Twitter</a> and <a
title="Scriptastique on Facebook" href="http://www.facebook.com//login.php">Facebook</a>! </strong></p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/03/11/identifying-each-page-using-body-tags-and-css/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Scriptastique web development roundup</title><link>http://www.ghacks.net/2009/03/09/scriptastique-web-development-roundup/</link> <comments>http://www.ghacks.net/2009/03/09/scriptastique-web-development-roundup/#comments</comments> <pubDate>Mon, 09 Mar 2009 12:55:01 +0000</pubDate> <dc:creator>Daniel Pataki</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[coding]]></category> <category><![CDATA[html]]></category> <category><![CDATA[php]]></category> <category><![CDATA[scriptastique]]></category> <category><![CDATA[web design]]></category> <category><![CDATA[web development]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=11035</guid> <description><![CDATA[As you all know, we started a web development section here on gHacks. After asking for your opinion and talking about it with Martin, we decided to keep writing 1-2 posts a week here, but move most of the material into a new site called Scriptastique. Right now we only have the blog, but tutorial [...]]]></description> <content:encoded><![CDATA[<p>As you all know, we started a web development section here on gHacks. After asking for your opinion and talking about it with Martin, we decided to keep writing 1-2 posts a week here, but move most of the material into a new site called <a
title="Web development" href="http://www.bluehost.com/cgi/suspended?d=scriptastique.com">Scriptastique</a>.</p><p>Right now we only have the blog, but tutorial sections and screencasts are on their way! To keep gHacks readers in the know, I will be doing a weekly short roundup of posts, if you like some of them, head on over to the site, take a look and participate in all the fun! So let&#8217;s jump to it, here&#8217;s what we covered on week 1.</p><ul><li>Checking MySQL queries for errors</li><li>Creating your first function in PHP</li><li>How the internet works &#8211; domains and hosting</li><li>Create cool icons in a flash for your website</li><li>Creating rounded corners using only CSS</li></ul><p>We have a few more up there, and you can follow us on Twitter and our RSS feed or join us on Facebook. If you have any questions or comments feel free to let me know!</p><p><span
id="more-11035"></span></p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/03/09/scriptastique-web-development-roundup/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Passing variables using in the URL</title><link>http://www.ghacks.net/2009/03/07/passing-variables-using-in-the-url/</link> <comments>http://www.ghacks.net/2009/03/07/passing-variables-using-in-the-url/#comments</comments> <pubDate>Fri, 06 Mar 2009 22:19:07 +0000</pubDate> <dc:creator>Daniel Pataki</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[dynamic content]]></category> <category><![CDATA[php]]></category> <category><![CDATA[url]]></category> <category><![CDATA[variables]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=10983</guid> <description><![CDATA[If you&#8217;ve seen some WordPress blogs or online stores you&#8217;ve probably seen url-s in the form of http://somepage.com/product.php?id=4. These sites pass variables to scripts using the url. The script will scan the url for these and you can use them in a database query for example. This is the technology that allows WordPress templates to [...]]]></description> <content:encoded><![CDATA[<p>If you&#8217;ve seen some WordPress blogs or online stores you&#8217;ve probably seen url-s in the form of http://somepage.com/product.php?id=4. These sites pass variables to scripts using the url. The script will scan the url for these and you can use them in a database query for example. This is the technology that allows WordPress templates to function, since you only need one page for all your posts.</p><p>Instead of creating a separate HTML page for each post we make, we enter our posts into a database. Each post is then assigned an id. We simply create one page, say posts.php and the code for that page contains a query, plus all the necessary HTML for displaying a post. This query will pull one specific post from the database and put the correct pieces where they should go in the template.  We can tell the script which one to pick by passing it a variable in the url. If the value of this variable is 135 for example, the post that will be pulled will be the one with this id.</p><p>You can see right away how valuable this is, you can build truly dynamic pages with this method. Your data is better organized in a database, and you can change the way you display it by simply modifying the HTML code, no need to recreate any content whatsoever. So how is this done on a code level? Let&#8217;s take a look!</p><p><span
id="more-10983"></span></p><p>You need to use a PHP file obviously, and after the extension you need to write the names and the values of the variables you want to pass in the following format: http://url.com/page.php?variable=value&amp;variable=value. Notice that initially we use a question mark to separate the variable name passed from the extension, but after each subsequent variable passed we use an ampersand.</p><p>You can easily retrieve these variables in the code, referencing them with $_GET['variable']. For example, let&#8217;s say the url you use is the following: http://scriptastique.com/post.php?post_id=345. In this case inside the PHP file the value of $_GET['post_id'] is 345.</p><p>Using the &#8216;get&#8217; method you can pass strings, not just integers, so you could pass the name of the referring url, the name of a user, whatever you need. You should be aware though, that using the get method is unsafe if you want to send sensitive data. For example, you wouldn&#8217;t want to pass a user&#8217;s password from one page to another using the get method for many reasons, but mainly because it is displayed in the url bar.</p><p>For other things like telling a script which post you want to show, or which category you want the description for it&#8217;s fine, and a very comfortable way of organizing a huge site into just a few files, in fact, I think this is one of the best features of PHP!</p><p><em>If you liked this article, perhaps you&#8217;d like to take a look at <a
href="http://www.bluehost.com/cgi/suspended?d=scriptastique.com">Scriptastique</a>, which is a blog (and upcoming tutorial site) aimed at professional and aspiring coders. We just started, but there are daily posts and the tutorials (along with screencasts) are on the way!</em></p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/03/07/passing-variables-using-in-the-url/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> </channel> </rss>
