Showing posts with label apache. Show all posts
Showing posts with label apache. Show all posts

Monday, 10 February 2014

Phpinfo function


phpinfo function
Phpinfo Function
The phpinfo function. We should detailed look to php installation so for example you may go later to look at GD library. Its a Image generate Images using its command-set its addition to php may not be included in original php installation. If some one ask you did you had kernel or GD images installed. You should know what its is its a Different library for php. You need to find a way to check every think in php installation and general information about php version some one must ask you or need to find out which version of php you using and different features of php version works with updated php version. Different features of php works with different versions of php. You must using older version of php and could not get some advantages of php updated features. so should check updated version. This stuff you can find out by phpinfo() function.So to call function its relatively simple Within php tags write phpinfo(); () Its a standard notation for calling function. Its a built-in function of php which is built ed in directory ofinstallations files.

Codes To Write phpinfo function :-


Code Phpinfo Function
Code PhpInfo Function
<?php
phpinfo();
?>

Output For Phpinfo Function

Phpinfo function
Output PhpInfo function Php



We can see php version 5.2.9 in output as you scroll down you will see many things enabled and all. Its a list of collection of our php installation  its having information about php core, apache , apache environmental  ftp support and many other stuff. Also gd libaray gd version and its also linked in apache. One thing you should always remember this file should not be upload on your server its available on your local machine. If you upload this file on server had change to hack your website. phpinfo file had lots of information about out php installation on our local machine from that data anyone can harm your files. If you had such file on server should delete it for security purpose.So phpinfo had an information about your php package.
Read More

Sunday, 9 February 2014

Writing Your First php file

Writing Your First Php File
Writing Your First Php File

This is a tutorial for how to write your First php file. In this tutorial we will learn about basic of creating php file what extension we going to give it. How we gonna show inside of the file to ensure that our web-server deals with it correctly because php is important web-server package you may need to specify in apache to look out at php files. you can do this in your http.com file which we looked up when we setup out apache installation. Php is server-side so what ever you write in between php tags would be not able to shown by people usually When you create html tags





<html>
<head>
</head>
<body>
</body>
</html>

Its seems this way will in php code :-

<?php ?>

well we can also specify php code in this way

<? ?>  <?php ?>

codes in this way.


<?php
//every things we write will goes here
?>

You can also combine php and html in pages of webserver.

codes :-

<?php
//your stuff
?>
<html>
//html tags
</html>

<?php
?>

OR

<?
//like that
?>

But i will prefer

<?php
?>

I have made root directory in my localhost to save file localhost/series/firstfile when we will use this link to open our firstfile screenshot1.
Screenshot1

In apache if save file name index.php or index.html it takes as default file whenever we call root directory at localhost it will open index.php bydefault.
Now we create file file.php in series/firstfile it will show you in localhost see screenshot1. Now let see combine php tags and html tags in file and see output
file.php code :-

<?php
?>
<html>
</html>

In this file when we see output screenshot2 let's see output view page source by right click..

Screenshot2

Screenshot3 you can see people can see out html tags well php is server side language so can not be seen by people.php codes are interrupted by web-server. php is server-side scripting language. If we save file name index.php we can not see the page which is in Screenshot2 Index of/series/firstfile and the list of files in it.because by default index.php will open automatically.

Screenshot3
Let create index.php in that i am writing simple commands of php like echo , echo is to use for print anything in output of php file.

Index.php codes:-

<?php

echo 'Hello World.';

?>

Path : localhost/series/firstfile/

first php file
FirstFile
Now you see screenshot6 its similar to screenshot5 just path of screenshot5 is localhost/series/firstfile/ just root directory and in screenshot6 you can see file name index.php same. no need towrite file name because its by default take file in root directory.only index name is configured in apache any other name you should declare with root directory in browser.



Read More

Creating Your First Php File

Creating Your First Php File
My First Php
This is a tutorial for creating our first in php file. We installed Xampp for Windows so, Now we are at the stage Xampp is running well and phpmyadmin works so we can work on database system in our local machine. We see our Xampp control panel apache and MySQL starts and stops in the services. In this services we focus on apache and MySQL which we use most frequently.

This tutorial is based on how to create your first file of php and also see its output. We will see phpinfo function in this and hope you can find great info in that ok. So go head and we need open up folder shown in Screenshot, its Xampp folder in C:\ drive C:\xampp by default its install xampp in c drive and it also depends in which drive you had setup your Xampp depends upon you by default its in c:\ drive. In Xampp folder you can see many folders, in that php folder installation folder where you can see all dll files php.ini files. Later in this tutorial, i will show you details about php.ini.


localhost
C:\xampp
htdocs is the folder i want you to focus as you can in Screenshot because we are creating our first php file which will be in this folder. Now let open browser you know now we are running our php files locally on our local machine so in browser we don’t need to write localhost\htdocs\ourfile.php because htdocs is our root directory where our file should be now lets go to htdocs folder and create file myfirstfile.php. Remember, when you create file your extension must be .php.

htdocs
htdocs
There are many text-editor depends on you which one you want to use. Text-editor such as notepad is the best example. I am using conTEXT, you can use notepad++ also. Now opening conTEXT, creating file and i will save it save as root as C:\xampp\htdocsdefault path for saving file and running it on local machine. So creating myfirstfile.php, now you can see local machine in browser open localhost/myfirstfile.php shown in screenshot3. We had only written data in file and it shows in the browser. In this way, we can access our files on browser by help of Xampp root directory.

myfirstfile.php
MyFirstFile.php
In screenshot 4, it is ConTEXT text editor software. Screenshot 5 shows in file>save as will save file name myfirstfile.php. .php is extension of php file will run that file on Xampp localhost on our webserver.

notepad++
Screenshot4
Files
Screenshot5
When i click save its automatically index highlighting. Index highlighting is it highlight php codes such as construction , string , variables, etc. This is the reason why i am using ConTEXT as my text editor. You can see in screenshot6 index highlighting is on. You can also modify index highlighting from option in ConTEXT software.

php Code
Screenshot6
Now see in browser our file localhost/myfirstfile.php, we press enter and this file will loaded in browser. Because its php file you should write html tags in it. Now simply, we write DATA in our php file and you can see in screenshot3 it shows in browser.
So in this way you can create folder directory root in it. So for creating our first file we had done this now our php file tags displayed in screenshot 8.

<?php
<?php ?>
<?php

?>
Its just similar  to how we write  html Codes.

<html>



</html


Read More

Installing Xampp Part -1

This is Php Tutorial of Tutorials JackPot. If you want to start as php developer, Then firstly you need to have a platform to test your codes. You must have already purchased your paid hosting check whether they allow php extensions or not ! 99% paid or free hosting allows you to run php on the server. Its pretty much obvious that in most cases most of the hosting companies gives this service to its customer.


Hosting
Hosting

What happens when you want to test everything locally on your computer.So firstly, create a php file and upload it to the server as above ,but we want to quickly and easily obtain its result on the local machine. So what we can do is that we can turn over our computer into a web server. Now, its highly not recommended to allow access to the web server and the files if its not properly configured, Otherwise you can have some security issues there. Let me show you a screenshot of how you can access an another portion your computer. Opening a port 80 on your computer which allow people to access everything you save into your htdoc folder. As going ahead, Ill explain you about how to create or install a mini web server on to your computer. As I am personally using “Xampp” I would advice you to download and install “Apache” as a web-server for php. Apache web-server allows you to compile in the background server, Since php is a server side language.It allows you to compile php files, run them and display the content of your programs in the browsers.

Localhost
LocalHost
So, basically you need something like xampp or wamp. I am showing you wamp so its available however i am going to be dealing with xampp and xampp by default directory things like that. So, if you are following this tutorial i am using xampp or otherwise you can take wamp and see you can get idea from this tutorial.

Xampp
Xampp
However you can also use “Wamp” for php which works on “IIS” server that can be easily installed on “Windows OS”.Working of both Xampp and Wamp are almost same,just the difference is about the folder where the file is saved.


Redirecting to Xampp, Firstly friends you need to visit Appache Friends.There you will find Xampp for Linux, Xampp for Windows, Xampp for Mac os x, Xampp for Solaris. Php can easily work on any of this operating system and its also free of cost.For support on how to install Xampp here are some screenshots.Download Xampp by clicking it on Xampp s Xampp Installation page

or
Method B : “Installation” without the installer   ( I highly recommend you to go with the installer method A.)




Read More

About Me

Welcome to Extra Tutorials! My name is Mohammed and I am the 22 year writer, website developer, and photographer behind the blog. Thanks for visiting! Tutorials Jackpot… In addition to Developer, I love to develop websites and I love to write. Starting a php Blog was inevitable for me. What began as a simple way to share all of my Tutorials with friends and family has developed into my Part time job.

Mohammed Padela

WHAT IS PHP PROGRAMMING

WHAT IS PHP PROGRAMMING
WHAT IS PHP PROGRAMMING

Follow Us

Popular Posts

Designed ByBlogger Templates