Archive for the ‘Php development’ Category

In first part, we came to know that good coding practices matters more for ourselves as well as for other PHP developers who might have revisit your code during maintenance or in redesigning of website or web application. We know write code in clean and compact manner save our and others time and efforts much as well as your code become futuristic. Moreover, writing comprehensive code facilitates debugging and other changes during and after the web development project.

 Now in this part I would like to tell you some different things from the coding practices. I would like to advise you to be simple as possible as so anyone can understand your project and get his or her solutions. If you are scrappy to include all new things you learn, you might be ending in a complex, but super sweet solution that won’t offer any benefits to your clients so it is mandatory to restrict yourself up to your aims and not complicate problem further.

The same thing happens when you predict yourself as an expert and try to show your expertness in coding by making it much complex and hard to understand. In due course, you may forget one thing that you always like to work on the project developed by other when you find it easy to understand and modify therefore, making others task difficult may annoy others and harm your client at the end. Moreover, there are chances that you have to revisit your own super complex code after some intervals and you might have forgot that what you have written and why so you put yourself in to a big trouble in debugging or redesigning your PHP development project.

Finally, I would like to advice that you need to share your code with your fellow PHP web Application developer or your PHP developer friends in the community. This not only will sharpen your coding but also offers others to get or learn something from you and this way you will pay back when you have gain from the community when you were in the learning process at the initial stage of your PHP developer career.

Conclusion

If you want to be a good PHP developer you should have good coding practices where you have to always think about the other PHP developers who might have to dive in your documents in order to maintenance or redesign of the PHP project. Writing good code and sharing it with others may give you more credit and learning experiences than you think.

In previous parts, we have revisited some performance, scalability, and PHP tuning related issues and not in this part of PHP MySQL development series, which is broadly focusing on the scalability of web application we will try to discuss some important aspects of load balancing.

During our PHP MySQL development we create we application with massive data and tons of interactivities between the dynamic application and end users. These all definitely lead to exert loads on the server, which has to manage all requests all the time forth and back. It is good thing that we start with a single server to handle these all sorts of loads on the dispatch as well as in order to run the web application smoothly on each client.

Another important thing is that you need to scale the web application in order to manage extra traffic or some more traffic each time you come up with some fresh initiatives. Now, in such scenario, single server is not capable to manage heavy load all the time and we need to take help of multiple servers. Technically, we can’t connect multiple servers directly with the web application or can’t split them without any intermediary server with appropriate software and hardware.

This intermediary server acts as the load-balancing server and allocates traffic judiciously to the other multiple servers with different software and hardware. Here PHP is ideal web development language to do horizontal scaling. You need not to worry about the numbers of servers you add in load-balancing server. The obvious role of load-balancing server is to provide central point to manage all incoming requests and dispatching them to the appropriate server and then again redirecting the responses from the corresponding servers to the end users in a highly synchronous manner.

There are two kids of load-balancers. The first one is software load-balancers and second is hardware load-balancers. These software balancers are install on Linux bases machines in most of the cases and have their own peculiarities in terms of built in page output caching, some gzip type of compression and other many things we need in a modern server. The big fishes are Apache, Nginx and Squid like software to do effective load balancing. If you can’t afford big brands you have Perlbal like cheaper software to help you out for small to medium projects.

The second part is of hardware load balancers that have some custom built software to manage the various hardware counterparts of the load-balancing software. In present market, Citrix Netscaler and F5 BigIP are well-known versions of the hardware load-balancers and server as good security barriers or firewalls for your web application.

Today Cloud computing is serving as new dimension in the load balancing, but here you have some distinct benefits despite their software only nature. Those benefits are coming from the unique in-built mechanisms of handling load balance across the all-existing instances. Although, cloud base load-balancers are stiff means shows less flexibility, but superb in terms of easy setup and their maintenance in cost effective manners.

In short, if you need good solution for load balancing you need to monitor the ability of manipulation or making caching of the data across the servers and sort out the most appropriate solution for you.

Conclustion

We all know that most of our PHP MySQL web application development suffering from load-balancing problems when question of scaling of web application arises. Thus, finding hardware that is more suitable or software base solution is the need of the present hour. We have many software and hardware as well as Cloud based load-balancers in the market so we need to be careful in selection.

Summary

Since, client satisfaction is easy where we have to deal with only some persons, but we can’t give guarantee of total satisfaction with our PHP web designs for their targeted audiences. We can’t create generic purpose web designs offering greater satisfaction to the all stake holders. We only satisfy some niche audience and some percentage of general audience with our PHP web designing endeavors.

Introduction

In our web development community particularly PHP development, it is general trends to look at the portfolio and find out the relevant project that PHP developer had done in past and match it with our concept or business requirements. Once things set okay, we handover our PHP web development project to that PHP web development company or freelancer PHP developer.

At PHP web developer point of view this behavior directly force us to satisfy the clients by judging their requirements, likes, dislikes and some business related issues. In verbose we say client-centric approach gracefully. Yes, that is easy to satisfy one-single entity, be it a person or a business by keen observations and experienced assumptions. Nevertheless, true difficulty start when our pure intentions to add some value in the business of the client or her personal endeavors where her target audience and their satisfactions matter more than her personal.

In this sense, if we look at closely to each project we encounter, we definitely find them unique in that sense that we have to satisfy different persons or audience each time and not a single project is alike to any other one. Thus, it is insane to comparing existing projects in the portfolio with our concept or our business requirements, rather we only tell that we are belong to the same niche by referring a project or a group of projects as reference.

Therefore, at web developers side no client is similar in needs than others so their projects. With this knowledge, we have to go for the target audience research every time we take new project on the hand, despite it belongs to the same category or niche. We need carefully listen to our client without mentioning that we have done similar projects before and will implement same things in your project too. Once we sort the needs of clients, we need to try to understand its target actual audience under the umbrella of that needs.

There are altogether different ways to reach at the different kind of targeted audiences for various kinds of project and no same methodologies or tricks will work in each case. If you are not assure of any method, please run a guerilla survey or user experience test of your product/software that ultimately will give you insight about it.

Now, if we are talking about the target audience here we can’t satisfy the all related people or groups with our designs so your guerilla survey may not be accurate all the time since it comprises only limited audience. If want to give guaranteed satisfaction we only can mention some percentage of our targeted audience, never 100% as a whole.

Summary

Due to have, a big developer community PHP is suffering from the security related issues a lot. Therefore, it is advisable to use secure coding practices for all sort of PHP developments and save your website from the plenty of vulnerability. There are user input data checking system and keeping off the error reporting are among the most desirable security aspects.

Introduction

Among all the programming languages, PHP is the easiest one to learn and start coding if you have any programming background or not. You simply need some basic HTML coding knowledge and some ideas about the syntax of programming at basic level, and of course, plenty of learning stuff at your side, you can start website development or edit your existing site in order to add some interactive and dynamic pages.

At the flip side, coding done by a fresher or inexperienced programmers may prove their website vulnerable to malicious attacks or some security breaches. If you want to save your website from such vulnerability, you should know some rules of secure PHP development or coding practices. Therefore, in this series I would like to introduce you to some valuable tips and rules to do secure PHP programming.

Validate User Data

The first rule is to create a system that can check and prevent your website from the data input done by all the users of your website, without any exception. If you think your website is useless for hackers and don’t have any chances to have malicious user. You might going in wrong because if there is no bad intended user come on your site, but your good users can commit some mistakes that may cost you dearly.

Therefore, it is advisable to check each data entered or action done through effective security measures. Here simple client-side validations using some JavaScript like weak measure won’t work and you need some strong measures to avoid further security breaches. Thus, trusting any user is insane act at security point of view.

 Turn Off Error Messages

 For a PHP web developer error message is life line to get insight about the development and mistakes she had committed before. Therefore, we are keeping error messaging system turn on always during our PHP web development environment. That is good, but worst for a live website as it can handover all clues and information regarding to your code, documents and databases as well as related web applications in directly. Therefore, it is advisable that you set “error_reporting” to ‘0’ value in ,htaccess or php.ini files in source code.

PHP is famous for its dynamic and interactive nature therefore, it may generate pages that let users to create their own usernames and passwords so PHP developers are using encryption methods to encrypt password before submission of forms field entry to the database field. Before sometime ago PHP web application programmers were using Message Digest Algorithm (MD5) function to encrypt the password into 128-bit string, but it was not sufficient against the modern attackers with modern technologies. Now most of the PHP website developers are using Secure Has Algorithm) SHA-1 function to create 160-bit string that is more secure than previous one.

In usual cases php.ini file consists of a setting termed as “register_globals” that means if this setting is on the server will create automatic global variables for many of the server’s variables and query strings. This is a big loophole in the security of the application. Therefore, many third party packages like CMS software, Joomla, Drupal etc. are demanding users to set register_globals off so automatic global variable generation stops and unauthorized users can’t access any sensitive data just guessing the name of the variable that validate the password. Thus, a smart PHP developer will set register_globals off in case of security issues.

We most of PHP web programmers are lazy at a point or sometime we are hard press to accomplish our task rapidly so client can reach at market earlier than her competitors we avoid thorough coding and good coding practices. Among these good practices giving the value to the variables which are validating the authentication process. Here value instantiation is important before the log-in procedure starts. If value installation is done we can prevent users from bypassing the verification process and get easy access to the protected areas which are not included in their access privileges. Moreover, value instantiation process block the users to start new sessions on an application, but some security issues remain their intact.

Conclusion :-

PHP is highly flexible web development language and this flexibility causes many problems as far as security is concern. In due course if we take some precautions before deploying PHP application we can save future damages with least efforts.