Security Tips for PHP Developers

Security Tips for PHP Developers

PHP is arguably the most powerful of all open-source programming languages.  No longer used solely for web pages, it is becoming an increasingly popular tool for stand-alone programs and corporate applications.  Despite all its power and flexibility, the PHP framework is far from secure.  The countless number of successful hacks on popular web applications such as Drupal, Joomla and Wordpress serve as solid evidence.  In this article, we will go over some of the most significant security issues to help strengthen your shared, VPS or dedicated hosting environment

Dangerous PHP Functions

All potentially dangerous PHP functions should be disabled and never used unless absolutely necessary.  Three that pose the biggest threats to security are “passthru”, “EVAL” and “shell_ exec.”  These functions can be disabled by editing the “disable_functions” value in the “php.ini” file.  EVAL is perhaps the most vulnerable of all because it enables the execution of remote PHP code.  If used in conjunction with an insecure global value, this particular function can result in a potentially catastrophic security breach.  Because applications such as ImageMagick require shell_exec, you should perform some research to find out which functions are required before disabling them.

Remote URL Injection

When enabled on a server, the “allow_url_fopen” option permits file functions like “file_get_contents()”, which could allow data to be retrieved from locations such as a remote website or FTP connection.  Since a standard PHP configuration has this function enabled by default, it is highly recommended that it be manually disabled to prevent potentially dangerous code exploits.  allow_url_fopen is very rarely used, thus, you should be able to disable it and still enjoy the full functionality of your website.

Insecure Code

There are many aspects that make PHP one of the most flexible platforms for web development.  However, it is this very flexibility that often results in security gaps that can lead to a compromised server or website.  This is especially true with the widely used web programs coded in the PHP language.  Some of today’s most popular content management systems have bugs and security holes in the supported plugins and even the core code itself.  For this reason, you should make it a priority to run the most recent and secure versions of PHP scripts and remain weary of plugins and modules.  In fact, unless their functionality is truly needed, you should try to keep your web application platforms simple with as few extensions as possible.

Conclusion

Programmers these days are faced with significant challenges due to the fact that the list of potential PHP security issues is rather extensive.  Even worse, the list continues to expand with the release of each new version.   That is why it is a developer’s job to take the necessary steps to ensure their code is secure as possible.  This can be done by smart coding, only using necessary functions and using updated PHP scripts.  In addition, better protection can be assured by doing business with a hosting firm who makes security a priority.  In order to give you secure environment for PHP projects, their hosting platform must be properly configured.  The combination of an inadequate PHP/web server is one of the major causes of successful security breaches.

Watch the video related to Php Scripts

Help answer the question about Php Scripts

I'm an artiste. I found PHP Scripts that I want to utilize to setup a dynamic site. Will Tech Support assist?
I have no idea how to modify or work PHP scripts. I'm getting re-acquainted w/Dreamweaver, but after importing PHP into DW,….then what? If tech support doesn't asisst in PHP set up, can someone point me in the right direction? Thanks

Digital D

About Author

You can get the best webhosting at Bluehost web hosting and joomla web hosting

18 Responses to “Security Tips for PHP Developers”

  1. monkeymanbob says:

    Nice work, you did pretty good.

  2. champ0y says:

    You’re really good man. You’ve got excellent talent.

  3. Faithless863 says:

    hm i couldn’t tell the difference between photograph and painting comparing the final resault.

    This is sick

  4. relientkfan153 says:

    The "something" can be accessed very easily with PHP. If you have a web page address that looks like this:

    index.php? month=september&name=smith&age=24

    Then you can access those values in PHP like this:

    <?php
    echo $_GET('month');
    echo $_GET('name');
    echo $_GET('age');
    ?>

    This will print septembersmith24.

    As for accessing a text file, that's easy too:

    <?php
    $text = file_get_contents( 'textfile.txt' );
    echo $text;
    ?>

    This will read the entire contents of the file textfile.txt into the variable $text, and then print it out for you.

    You can also access many databases with PHP, I highly recommend you use MySQL. It's a bit too complicated to describe here, though. There are some good references made to good books by folks above. The "Teach Yourself" series is great.

  5. Atticus says:

    You can use a menu maker if you're not sure how to code something on your own. There are a gazillion of them out there and many are even free. Pick one that suits you…

    http://www.google.com/search?source=ig&hl=en&rlz=&q=web+menu+maker&btnG=Google+Search

  6. superchode20164 says:

    amazing! Willy teach me how to paint like you!

  7. Forbidia says:

    Brilliant Willy, Just Brilliant =D

  8. Simplicated says:

    If you have sensitive files that should be accessible only by scripts, put them somewhere on the server other than the web root. Your scripts will still be able to access them, but nobody can pull them off the web.

    /
    – /htdocs
    – — /www.site.com
    – /securedocs

  9. Ars Magicana Arcanum says:

    Windows XP PRO has functionality for running a web server built in

    IIS is an option, however, under a "Default" installation of XP Pro, it might not be installed

    Control panel – > add / remove programs -> Add Remove Windows COmponents – Check "Internet Information Services"

    You could also look @ apache as has been mentioned, however, IIS is PART of windows.

  10. ampersand1 says:

    http://www.phpfreaks.com

    If you are ready invest: Get Larry Ullman: 'PHP …" Nice book

  11. virgocrabtiger373 says:

    http://www.phpfreaks.com/tutorial_cat/8/Basics-&-Beginner-Tutorials.php

  12. warah110 says:

    Perfect.

  13. Mike says:

    Hi,

    Best Site to Learn PHP http://www.w3schools.com/php/default.asp

    I know this Answer Will solve your problem. Do one thing visit http://www.zakhas.com/Forum be a member first and Download 1800 Industry standard PHP Projects and source codes. Directly without any interrupting. Follow below link for direct access to the download link.http://www.zakhas.com/Forum/ViewThread.asp?Thread=161&Forum=26
    Definitly it will solve your problem. Download it BE Quick.

    Or you can try this sites below

    http://www.planetsourcecodes.com

    or

    http://www.scriptswave.com/free/scripts/php_scripts/9.html

    If you find this answer is best then you can choose it as best answer.

  14. TheTroubadourMusic says:

    :O

    :O

    :O

    how is this not a real photo?

  15. Jeremy H says:

    I don't think there is such a thing as a PHP emulator, and I don't know why you'd need one. It's likely that you either didn't install PHP and apache correctly or you aren't using it right.

    Use XAMPP to install PHP and apache. It will also include MySQL and phpMyAdmin (which you will need sooner or later) and some other good stuff too. It's much easier than trying to configure PHP and apache by hand. Best of all, it's all configured to run together immediately. XAMPP and all of its components are free and open source.
    http://www.apachefriends.org/en/xampp.html

    Once you've got a web server, you need to turn it on (that's not automatic.) There's a nice control panel that makes this easy with XAMPP. PHP files will only work if they're in a specific subdirectory (usually htdocs in the apache directory structure) Also, you can't just load a PHP file into the browser the same way you do an HTML file. Instead, you need to point the browser to
    http://localhost/yourFileName.php

    PHP is called by the server, so if you use a mechanism (like the file:// directive) that bypasses the server, your PHP programs won't run.

  16. Sameer A says:

    http://www.elite.ro/free-hosting-php/
    http://www.awardspace.com/
    http://www.free-phphosts.com/
    http://www.freehostia.com/free_hosting.html

    Really what you need to run php is some one who also offers a sql database these do but I dont get the website builder thing?
    if your messing around with php why would you need a WYSIWYG builder?

  17. lidiabarbarita says:

    Very nice!!

  18. avb17018411 says:

    woww that’s really relax and beatiful soung .good picture of jhony depp !

Leave a Reply