Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Tutorials
[TUT] Integrating PHP with Apache! [part of my Other Tutorial]
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Johnniyo" data-source="post: 222398" data-attributes="member: 16948"><p style="text-align: center"><strong>This is part of my other tutorial, the original can be found here:</strong></p> <p style="text-align: center"></p> <p style="text-align: center"><a href="http://devbest.com/threads/tut-ultimate-guide-to-making-a-habbo-retro-webserver-install-guide-make-a-hotel.34613/" target="_blank">http://devbest.com/threads/tut-ultimate-guide-to-making-a-habbo-retro-webserver-install-guide-make-a-hotel.34613/</a></p> <p style="text-align: center"></p> <p style="text-align: left"><strong><span style="color: #ff0000">Integrating PHP with Apache is difficult, and is the hardest step of the webserver installation, therefore you will NEED to follow every single detail to ensure that you have installed it correctly. Please pay close attention to the detail - I will try to make this as noob friendly as possible.</span></strong></p> <p style="text-align: left"></p> <p style="text-align: left"></p> <p style="text-align: center"><strong>There is an issue with the Spoilers, can't work out what the hell is wrong with it, but I will try to sort it out later. For now, you will just need to click it to find the right content.</strong></p> <p style="text-align: left"><strong>Step 1: Extraction!</strong></p><p><strong>[spoiler][/spoiler]</strong>[spoiler]</p><p style="text-align: center">Begin by looking for the <strong>php-5.2.zip</strong> in your <strong>Web Kit.</strong></p> <p style="text-align: center"><strong><img src="http://i.imgur.com/hPGsBUb.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></strong></p> <p style="text-align: center"><strong><img src="http://i.imgur.com/H6c8TrF.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></strong></p> <p style="text-align: center"></p> <p style="text-align: center">Then, go to the <strong>Start Menu</strong> and click <strong>Computer</strong> (whilst leaving your PHP files window OPEN).</p> <p style="text-align: center"><img src="http://i.imgur.com/7FHrD2n.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"></p> <p style="text-align: center">On <strong>Computer</strong>, go to your <strong>Local Disk Drive</strong>.</p> <p style="text-align: center"><img src="http://i.imgur.com/LVqck6n.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"></p> <p style="text-align: center">In the <strong>Local Disk Drive</strong>, create a <strong>New Folder,</strong> and call it <strong>PHP.</strong></p> <p style="text-align: center"><strong><img src="http://i.imgur.com/QZz0Bax.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></strong></p> <p style="text-align: center"><img src="http://i.imgur.com/TfXTdJw.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"></p> <p style="text-align: center">Go back to your <strong>php-5.2.zip </strong>file, and <strong>copy all the contents </strong>of the <strong>php-5.2.zip</strong> to your new<strong>PHP </strong>folder you made into the <strong>Local Disk</strong>.</p> <p style="text-align: center"><img src="http://i.imgur.com/Mbbg3zS.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"></p> <p style="text-align: center">Make sure that there is a<strong> php5apache2_2.dll</strong> file in your <strong>PHP</strong> folder. Once you've done that, that is it for extraction!</p><p>[/spoiler]</p><p> </p><p><strong>Step 2: Recognition!</strong></p><p>[spoiler]</p><p style="text-align: center">We will need to now add <strong>PHP</strong> to the <strong>System Environment Variables List</strong>. To do this, start by going onto the <strong>Start Menu</strong> and search for <strong>"system variables"</strong>. The result should come as <strong>Edit the system environment variables </strong>under the <strong>Control Panel</strong>. Open it.</p> <p style="text-align: center"><img src="http://i.imgur.com/kwQ3Rnx.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"></p> <p style="text-align: center">When the <strong>System Properties</strong> window comes up, click on the <strong>Environment Variables</strong> button, located above the <strong>Apply</strong> button.</p> <p style="text-align: center"><img src="http://i.imgur.com/luvDjMt.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"></p> <p style="text-align: center">When the <strong>Environment Variables</strong> come up, look for the <strong>Path</strong> variable, under the <strong>System Variables </strong>(hint: under the Variables bar, it should be called Path).</p> <p style="text-align: center"><img src="http://i.imgur.com/qKQLdjW.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"></p> <p style="text-align: center">Click <strong>Edit to edit the Path variable, </strong>and add the following line to the end of the list (make sure it is the very end of the list!)</p> <p style="text-align: center"></p> <p style="text-align: center"><strong>;C:\PHP;C:\PHP\ext</strong></p> <p style="text-align: center"></p> <p style="text-align: center"></p> <p style="text-align: center"><img src="http://i.imgur.com/KroQnBp.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"></p> <p style="text-align: center">Then click OK, and save your settings. That is it for this step!</p><p></p><p>[/spoiler]</p><p> </p><p><strong>Step 3: Integration!</strong></p><p><strong>[spoiler][/spoiler]</strong>[spoiler]This will be the hardest, and final step. To begin, go to your<strong> PHP</strong> folder you created in the<strong> Local Disk</strong>.Look for a file called 'libmysql.dll'. Copy this over to your <strong><span style="font-family: 'courier new'">system32</span></strong> folder (this folder is located in your Local Disk, under <strong><span style="font-family: 'courier new'">Windows</span></strong>).</p><p><img src="http://i.imgur.com/X4t0vjm.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p> </p><p>Then, you can close the <strong><span style="font-family: 'courier new'">system32</span></strong><span style="font-family: 'georgia'"> folder, but keep the PHP folder open. In the folder, find a file called <strong>php-recommended.ini</strong>. Rename it to<strong> php.ini</strong>.</span></p><p><img src="http://i.imgur.com/kfAQK5J.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p> </p><p>Then open your <strong>php.ini</strong> in a Text Editor. For this, I will use <strong>Notepad++</strong> (just a preference). <strong>It is useful if you backup your file before editing, in-case something goes wrong. </strong>You may also find<strong> CTRL+F </strong>useful for this step.</p><p> </p><p>Find the<strong> <span style="font-family: 'courier new'">doc_root</span></strong><span style="font-family: 'georgia'"> property in your configuration. Set this to the folder of your apache htdocs. If you installed it using my path, enter "<strong>C:\Apache2.2\htdocs"</strong>. Otherwise, enter the path where your <strong>htdocs</strong> resides </span><span style="font-family: 'georgia'">(hint: this is under the Apache Folder, and also <strong>always</strong> use quotation marks (" ") to open and end your path.</span></p><p> </p><p><img src="http://i.imgur.com/kFeGqCJ.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p> </p><p>Then, find <strong>php_mysqli.dll</strong>. Uncomment the 2 lines with <strong>php_mysql.dll</strong> and <strong>php_mysqli.dll</strong>. Uncomment means remove the semicolon (the one that shows before the line begins, if you're using <strong>Notepad++</strong>, when you remove it, it should not be green anymore).</p><p><img src="http://i.imgur.com/H1SdgMf.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p> </p><p>Then, find the property called<strong> extension_dir</strong> and set it <strong>"C:\PHP\ext"</strong>.</p><p><img src="http://i.imgur.com/k4IJH76.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p> </p><p>Once that is done, <strong>Save it</strong> and close it. We will now tell Apache that PHP is installed, and that Apache should use it.</p><p> </p><p>To do this, go to the<strong> Start Menu</strong>, then <strong>All Programs</strong>, and then open the <strong>Apache HTTP Server 2.2</strong>, and then under <strong>Configure Apache Server</strong>, open the <strong>Edit the Apache httpd.conf Configuration File</strong> option.</p><p><img src="http://i.imgur.com/l7ZMvBs.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p> </p><p>Go to right the very end of the configuration, add the following lines:</p><p style="text-align: center"></p> <p style="text-align: center"><strong>LoadModule php5_module "c:/php/php5apache2_2.dll"</strong></p> <p style="text-align: center"><strong>AddType application/x-httpd-php .php .php5</strong></p> <p style="text-align: center"><strong>PHPIniDir "c:/php"</strong></p> <p style="text-align: center"></p> <p style="text-align: left"><strong><img src="http://i.imgur.com/BP9wfUJ.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></strong></p> <p style="text-align: center"></p> <p style="text-align: left">Then, find the property called DirectoryIndex and add index.php and index.php5 to the list. Once you've done that, save it and close it.</p> <p style="text-align: left"><img src="http://i.imgur.com/VPdomZx.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: left"></p> <p style="text-align: left">Then, restart your Apache Server and it should all be set! A basic working webserver, ready to run any web apps you want!</p> <p style="text-align: left"></p><p>[/spoiler]<p style="text-align: left"></p> <p style="text-align: left"></p> <p style="text-align: left"><strong>If you have any issues, PM me or read my Troubleshooting in my original thread.</strong></p></blockquote><p></p>
[QUOTE="Johnniyo, post: 222398, member: 16948"] [CENTER][B]This is part of my other tutorial, the original can be found here:[/B][/CENTER] [CENTER] [/CENTER] [CENTER][URL]http://devbest.com/threads/tut-ultimate-guide-to-making-a-habbo-retro-webserver-install-guide-make-a-hotel.34613/[/URL][/CENTER] [CENTER] [/CENTER] [LEFT][B][COLOR=#ff0000]Integrating PHP with Apache is difficult, and is the hardest step of the webserver installation, therefore you will NEED to follow every single detail to ensure that you have installed it correctly. Please pay close attention to the detail - I will try to make this as noob friendly as possible.[/COLOR][/B][/LEFT] [LEFT] [/LEFT] [LEFT] [/LEFT] [CENTER][B]There is an issue with the Spoilers, can't work out what the hell is wrong with it, but I will try to sort it out later. For now, you will just need to click it to find the right content.[/B][/CENTER] [LEFT][B]Step 1: Extraction![/B][/LEFT] [B][spoiler][/spoiler][/B][spoiler] [CENTER]Begin by looking for the [B]php-5.2.zip[/B] in your [B]Web Kit.[/B][/CENTER] [CENTER][B][IMG]http://i.imgur.com/hPGsBUb.png[/IMG][/B][/CENTER] [CENTER][B][IMG]http://i.imgur.com/H6c8TrF.png[/IMG][/B][/CENTER] [CENTER] [/CENTER] [CENTER]Then, go to the [B]Start Menu[/B] and click [B]Computer[/B] (whilst leaving your PHP files window OPEN).[/CENTER] [CENTER][IMG]http://i.imgur.com/7FHrD2n.png[/IMG][/CENTER] [CENTER] [/CENTER] [CENTER]On [B]Computer[/B], go to your [B]Local Disk Drive[/B].[/CENTER] [CENTER][IMG]http://i.imgur.com/LVqck6n.png[/IMG][/CENTER] [CENTER] [/CENTER] [CENTER]In the [B]Local Disk Drive[/B], create a [B]New Folder,[/B] and call it [B]PHP.[/B][/CENTER] [CENTER][B][IMG]http://i.imgur.com/QZz0Bax.png[/IMG][/B][/CENTER] [CENTER][IMG]http://i.imgur.com/TfXTdJw.png[/IMG][/CENTER] [CENTER] [/CENTER] [CENTER]Go back to your [B]php-5.2.zip [/B]file, and [B]copy all the contents [/B]of the [B]php-5.2.zip[/B] to your new[B]PHP [/B]folder you made into the [B]Local Disk[/B].[/CENTER] [CENTER][IMG]http://i.imgur.com/Mbbg3zS.png[/IMG][/CENTER] [CENTER] [/CENTER] [CENTER]Make sure that there is a[B] php5apache2_2.dll[/B] file in your [B]PHP[/B] folder. Once you've done that, that is it for extraction![/CENTER] [B][/B][/spoiler][B][/B] [B]Step 2: Recognition![/B] [spoiler] [CENTER]We will need to now add [B]PHP[/B] to the [B]System Environment Variables List[/B]. To do this, start by going onto the [B]Start Menu[/B] and search for [B]"system variables"[/B]. The result should come as [B]Edit the system environment variables [/B]under the [B]Control Panel[/B]. Open it.[/CENTER] [CENTER][IMG]http://i.imgur.com/kwQ3Rnx.png[/IMG][/CENTER] [CENTER] [/CENTER] [CENTER]When the [B]System Properties[/B] window comes up, click on the [B]Environment Variables[/B] button, located above the [B]Apply[/B] button.[/CENTER] [CENTER][IMG]http://i.imgur.com/luvDjMt.png[/IMG][/CENTER] [CENTER] [/CENTER] [CENTER]When the [B]Environment Variables[/B] come up, look for the [B]Path[/B] variable, under the [B]System Variables [/B](hint: under the Variables bar, it should be called Path).[/CENTER] [CENTER][IMG]http://i.imgur.com/qKQLdjW.png[/IMG][/CENTER] [CENTER] [/CENTER] [CENTER]Click [B]Edit to edit the Path variable, [/B]and add the following line to the end of the list (make sure it is the very end of the list!)[/CENTER] [CENTER] [/CENTER] [CENTER][B];C:\PHP;C:\PHP\ext[/B][/CENTER] [CENTER] [/CENTER] [CENTER] [/CENTER] [CENTER][IMG]http://i.imgur.com/KroQnBp.png[/IMG][/CENTER] [CENTER] [/CENTER] [CENTER]Then click OK, and save your settings. That is it for this step![/CENTER] [/spoiler] [B]Step 3: Integration![/B] [B][spoiler][/spoiler][/B][spoiler]This will be the hardest, and final step. To begin, go to your[B] PHP[/B] folder you created in the[B] Local Disk[/B].Look for a file called 'libmysql.dll'. Copy this over to your [B][FONT=courier new]system32[/FONT][/B] folder (this folder is located in your Local Disk, under [B][FONT=courier new]Windows[/FONT][/B]). [IMG]http://i.imgur.com/X4t0vjm.png[/IMG] Then, you can close the [B][FONT=courier new]system32[/FONT][/B][FONT=georgia] folder, but keep the PHP folder open. In the folder, find a file called [B]php-recommended.ini[/B]. Rename it to[B] php.ini[/B].[/FONT] [IMG]http://i.imgur.com/kfAQK5J.png[/IMG] Then open your [B]php.ini[/B] in a Text Editor. For this, I will use [B]Notepad++[/B] (just a preference). [B]It is useful if you backup your file before editing, in-case something goes wrong. [/B]You may also find[B] CTRL+F [/B]useful for this step. Find the[B] [FONT=courier new]doc_root[/FONT][/B][FONT=georgia] property in your configuration. Set this to the folder of your apache htdocs. If you installed it using my path, enter "[B]C:\Apache2.2\htdocs"[/B]. Otherwise, enter the path where your [B]htdocs[/B] resides [/FONT][FONT=georgia](hint: this is under the Apache Folder, and also [B]always[/B] use quotation marks (" ") to open and end your path.[/FONT] [IMG]http://i.imgur.com/kFeGqCJ.png[/IMG] Then, find [B]php_mysqli.dll[/B]. Uncomment the 2 lines with [B]php_mysql.dll[/B] and [B]php_mysqli.dll[/B]. Uncomment means remove the semicolon (the one that shows before the line begins, if you're using [B]Notepad++[/B], when you remove it, it should not be green anymore). [IMG]http://i.imgur.com/H1SdgMf.png[/IMG] Then, find the property called[B] extension_dir[/B] and set it [B]"C:\PHP\ext"[/B]. [IMG]http://i.imgur.com/k4IJH76.png[/IMG] Once that is done, [B]Save it[/B] and close it. We will now tell Apache that PHP is installed, and that Apache should use it. To do this, go to the[B] Start Menu[/B], then [B]All Programs[/B], and then open the [B]Apache HTTP Server 2.2[/B], and then under [B]Configure Apache Server[/B], open the [B]Edit the Apache httpd.conf Configuration File[/B] option. [IMG]http://i.imgur.com/l7ZMvBs.png[/IMG] Go to right the very end of the configuration, add the following lines: [CENTER] [/CENTER] [CENTER][B]LoadModule php5_module "c:/php/php5apache2_2.dll"[/B][/CENTER] [CENTER][B]AddType application/x-httpd-php .php .php5[/B][/CENTER] [CENTER][B]PHPIniDir "c:/php"[/B][/CENTER] [CENTER] [/CENTER] [LEFT][B][IMG]http://i.imgur.com/BP9wfUJ.png[/IMG][/B][/LEFT] [CENTER] [/CENTER] [LEFT]Then, find the property called DirectoryIndex and add index.php and index.php5 to the list. Once you've done that, save it and close it.[/LEFT] [LEFT][IMG]http://i.imgur.com/VPdomZx.png[/IMG][/LEFT] [LEFT] [/LEFT] [LEFT]Then, restart your Apache Server and it should all be set! A basic working webserver, ready to run any web apps you want![/LEFT] [LEFT][/LEFT][/spoiler][LEFT][/LEFT] [LEFT] [/LEFT] [LEFT][B]If you have any issues, PM me or read my Troubleshooting in my original thread.[/B][/LEFT] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Tutorials
[TUT] Integrating PHP with Apache! [part of my Other Tutorial]
Top