Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fedora - PHP Development on Fedora with Eclipse

#1
PHP Development on Fedora with Eclipse

<div style="margin: 5px 5% 10px 5%;"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/php-development-on-fedora-with-eclipse.png" width="802" height="842" title="" alt="" /></div><div><p><a href="https://projects.eclipse.org/projects/eclipse">Eclipse</a> is a full-featured free and open source IDE developed by the Eclipse Foundation. It has been around since 2001. You can write anything from C/C++ and Java to PHP, Python, HTML, JavaScript, Kotlin, and more in this IDE. </p>
<p> <span id="more-30437"></span> </p>
<h2>Installation</h2>
<p>The software is available from Fedora’s official repository. To install it, invoke: </p>
<pre class="wp-block-preformatted">sudo dnf install eclipse</pre>
<p>This will install the base IDE and Eclipse platform, which enables you to develop Java applications. In order to add PHP development support to the IDE, run this command: </p>
<pre class="wp-block-preformatted">sudo dnf install eclipse-pdt</pre>
<p>This will install PHP development tools like PHP project wizard, PHP server configurations, composer support, etc. </p>
<h2>Features</h2>
<p>This IDE has many features that make PHP development easier. For example, it has a comprehensive project wizard (where you can configure many options for your new projects). It also has built-in features like composer support, debugging support, a browser,a terminal, and more. </p>
<h2>Sample project</h2>
<p>Now that the IDE is installed, let’s create a simple PHP project. Go to <em>File →New → Project</em>. From the resulting dialog, select <em>PHP project</em>. Enter a name for your project. There are some other options you might want to change, like changing the project’s default location, enabling JavaScript, and changing PHP version. See the following screenshot. </p>
<figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/php-development-on-fedora-with-eclipse.png" alt="" class="wp-image-30438" /><figcaption>Create A New PHP Project in Eclipse</figcaption></figure>
<p>You can click the <em>Finish</em> button to create the project or press <em>Next</em> to configure other options like adding include and build paths. You don’t need to change those in most cases. </p>
<p>Once the project is created, right click on the project folder and select <em>New → PHP File</em> to add a new PHP file to the project. For this tutorial I named it <em>index.php</em>, the conventionally-recognized default file in every PHP project. </p>
<figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/php-development-on-fedora-with-eclipse-1.png" alt="" class="wp-image-30440" /></figure>
<p>Then add the your code to the new file. </p>
<figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/php-development-on-fedora-with-eclipse-2.png" alt="" class="wp-image-30441" /><figcaption>Demo PHP code</figcaption></figure>
<p>In the example above, I used CSS, JavaScript, and PHP tags on the same page mainly to show that the IDE is capable of supporting all of them together. </p>
<p>Once your page is ready, you can see the result output by moving the file to your web server document root or by creating a development PHP server in the project directory. </p>
<p>Thanks to the built-in terminal in Eclipse, we can launch a PHP development server right from within the IDE. Simply click the terminal icon on the toolbar (<img class="wp-image-30444" style="width: 21px" src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/php-development-on-fedora-with-eclipse-3.png" alt="Terminal Icon" />) and click <em>OK</em>. In the new terminal, change to the project directory and run the following command:</p>
<pre class="wp-block-preformatted">php -S localhost:8080 -t . index.php </pre>
<figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/php-development-on-fedora-with-eclipse-4.png" alt="" class="wp-image-30446" /><figcaption>Terminal output</figcaption></figure>
<p>Now, open a browser and head over to http://localhost:8080. If everything has been done correctly per instructions and your code is error-free, you will see the output of your PHP script in the browser.</p>
<figure class="wp-block-image size-large"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/php-development-on-fedora-with-eclipse-5.png" alt="" class="wp-image-30442" /><figcaption>PHP output in Fedora</figcaption></figure>
</div>


https://www.sickgaming.net/blog/2020/02/...h-eclipse/
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Fedora - Contribute to Fedora 39 Upgrade, Virtualization, and Cloud Test Day xSicKxBot 0 2,031 09-30-2023, 03:56 AM
Last Post: xSicKxBot
  Fedora - Share your game achievements with Gamerzilla xSicKxBot 0 1,002 09-27-2023, 09:59 AM
Last Post: xSicKxBot
  Fedora - Using Cockpit to graphically manage systems, without installing Cockpit on xSicKxBot 0 895 09-26-2023, 06:41 AM
Last Post: xSicKxBot
  Fedora - Announcing Fedora Linux 39 Beta xSicKxBot 0 917 09-20-2023, 09:48 AM
Last Post: xSicKxBot
  Fedora - Contribute at Passkey Auth, Fedora CoreOS and IoT Test Week xSicKxBot 0 890 09-19-2023, 12:23 PM
Last Post: xSicKxBot
  Fedora - Quick Fedora shirt update and sale of last stock with the old logo xSicKxBot 0 942 09-16-2023, 12:28 PM
Last Post: xSicKxBot
  Fedora - Contribute at the Fedora Linux Test Week for Kernel 6.5 and Toolbx Test Day xSicKxBot 0 950 09-11-2023, 02:47 PM
Last Post: xSicKxBot
  Fedora - Fedora Linux Flatpak cool apps to try for September xSicKxBot 0 931 09-10-2023, 04:59 PM
Last Post: xSicKxBot
  Fedora - Contribute at the Test Week for the Anaconda WebUI Installer for Fedora Wor xSicKxBot 0 923 09-09-2023, 11:54 PM
Last Post: xSicKxBot
  Fedora - Docs workshop: Virtually writing together xSicKxBot 0 967 09-09-2023, 05:08 AM
Last Post: xSicKxBot

Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum software by © MyBB Theme © iAndrew 2016