Zend Framework on Ubuntu Linux
Showing posts with label Installation Php. Show all posts
Showing posts with label Installation Php. Show all posts
Install Zend Framework in Mac OS
Installing zend Framework in Mac Os
Labels:
Installation Php,
Php Lessons
Php installing MAMP on Mac Os
The Steps to install MAMP are as below.
Download software : http://mamp.info/en/Click Download Now button. (MAMP is free, but the download also includes the commercial product, MAMP Pro, which makes administering MAMP easier.
MAMP Pro is not needed for this tutorial, and you don’t have to install it either.)
Unzip the file and then, License Agreement will appear; click Agree.
Now, you need to start the Web server.
In Applications->MAMP, start the MAMP program, and then click the Start Servers button if a red light appears to the left of either Apache or MySQL (see Snap2).
Download software : http://mamp.info/en/Click Download Now button. (MAMP is free, but the download also includes the commercial product, MAMP Pro, which makes administering MAMP easier.
MAMP Pro is not needed for this tutorial, and you don’t have to install it either.)
Unzip the file and then, License Agreement will appear; click Agree.
Snap 1: Installing MAMP is just a process of downloading a file, unzip it, and dragging the MAMP folder into your Applications folder.
Now, you need to start the Web server.
TIP: Since you’ll frequently access the MAMP program to turn the Web server on and off, it’s a good idea to add it to the OS X Dock.
In Applications->MAMP, start the MAMP program, and then click the Start Servers button if a red light appears to the left of either Apache or MySQL (see Snap2).
Snap 2: When the servers are running, a green button to the left of Apache Server and MySQL Server lights up. To stop the servers, click the Stop Servers button. A red light next to either server indicates that the server is turned off.
Snap 3: After installing MAMP , set Apache and MySQL to their normal port settings of 80 and 3306. You can’t do this setting, however, if you don’t have administrator privileges for your computer. In that case, you have to stick to the 8888 and 8889 port settings that MAMP ships with. When you visit a Web page running on your local server, you have to add the port, like this: http://localhost:8888/my_cool_page.php.
Snap 4: The MAMP home page gives you access to a few useful tools, like phpMyAdmin, which you’ll use for working with MySQL databases. You can always go to the MAMP homepage by typing its URL: http://localhost/MAMP; or, in the MAMP controller program, clicking the Open Start Page button (Snap 2).
Labels:
Installation Php
Most Frequently used php configuration directives : php.ini
Below are the most frequntly used php directives.
You have to change php.ini file for making confuguration level setting.
This just means changing these directive’s option and value.
Php.ini file is configuration file for php, You can find the location of php.ini file from
Go to http://locahost/xamp and the click phpinfo()
1) short_open_tag = Off
This will not allow the shout tags like , if this is set off
2) max_execution_time = 30
Maximum execution time of th script, in seconds
3) error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
error_reporting setting:- Show all errors, except for notices and coding standards warnings
error_reporting = E_ALL & ~E_NOTICE
- Show all errors, except for notices
error_reporting = E_ALL & ~E_NOTICE | E_STRICT
- Show only errors
error_reporting= E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
4) display_errors = On
Print errors (as a part of the output). For production web sites turn this feature off, and use error logging instead (see below). Keeping display_errors enabled on a production web site may reveal security information to end users, such as file paths on your Web server, your database schema or other information.
5) log_errors = On
Create Log of errors into a log file (server-specific log, or error_log). You should use error logging in place of error displaying on production web sites.
6) register_globals = Off
You should do your best to write your scripts so that they do not require register_globals to be on.
Using form variables as globals can easily lead to possible security problems, if the code is not very well. Making register_global on can make securitry hole.
7) memory_limit = 128M
This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available memory on a server.
8) post_max_size = 8M
Maximum size of POST data that PHP will accept. In the above example Post max size is 8MB.
This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. If memory limit is set by your configure script, memory_limit also affects file uploading. Generally , memory_limit should be more than post_max_size .
9) file_uploads = On
Allow HTTP file uploads or not.
10) upload_max_filesize = 2M
Maximum allowed size for uploaded files. Default is 2MB.
11) allow_url_fopen = On
Allow the treatment of URLs (like http:// or ftp://) as files if on.
Setting Up Virtual Hosts for XAMPP
Running a Web server on your computer is a great way to speed up Web site development. By previewing your Web pages directly through a Web server on your own computer you can test out server-side programming like server-side include files, form processing scripts, or database-driven Web pages. However, there’s one problem associated with running a server on your own computer: by default, you only have a single "domain"–http://localhost/–so if you work on more than one Web site you put them all under "localhost" in different directories. This isn’t very real world and can cause problems when using server-side includes and root-relative links. Fortunately there’s a better way.
Adding a Virtual Host is a 2-step process:
For set up XAMPP, visit the XAMPP instructions page.
Virtual Hosts
Virtual Hosts give you the ability to "host" more than one domain on your computer. With a virtual host you can have separate domain names for each of your Web sites: for example, http://clientABC/ for one site and http://clientXYZ/ for another. When you type the URL for the Virtual Host in your Web browser, the browser doesn’t go out onto the internet to find the site, but instead asks for the proper file from the Web server running on your computer.Adding a Virtual Host is a 2-step process:
- Add a new entry to your computer’s hosts file.
A hosts file can be used to point requests for a domain to a particular IP addressin other words, it lets you re-direct communications to a particular domain. In the case of a virtual host, it can tell the computer to NOT go out on the internet when you type a particular URL like http://clientABC/, but instead look for that particular domain on your own computer.
- Edit the Apache configuration file to accept Virtual Hosts and define the particular Virtual Hosts you want to setup on your computer.
The first step above, merely redirects requests from a particular domain to your computer, but this step prepares the Web server on your computer for handling those requests. In this step, you not only provide the name of the Virtual Host, but also tell Apache where the files for the site are located on your computer.
Steps in Detail
- Launch Notepad and open the hosts file located at C:\windows\system32\drivers\etc\hosts. (You may not be able to see the windows folder–some files are hidden by default under Windows. Here are help to make files visible.)
On Vista, you’ll also need to have access to change the hosts file. To do that, launch Notepad by right clicking on Notepad from the Start menu and choosing "Run As Administrator." This will allow you to edit and save the file.
- At the end of that file type:
127.0.0.1 clientABC.local 127.0.0.1 is how a computer refers to itself—it’s an IP address that points back to the computer, kind of like a computer’s way of saying "ME." The second part (clientABC.local) is the "domain" of the virtual host. To visit this domain in a Web browser you’d type http://clientABC.local. You don’t have to add the .local part to the hosts files—you could just as easily add 127.0.0.1 clientABC and access the site in your Web browser with http://clientABC—but I find it helpful for differentiating between a real Web site out on the Internet like clientABC.com, and the test sites I have running on my own computer.
- Save and close the hosts file.
That finishes the first part of this process. You’ve prepared your system to handle requests to http://clientABC.local. Now you need to inform the Web server, Apache, how to handle those requests.
- In Notepad open the Apache configuration file located at
- At the bottom of that file add:
NameVirtualHost * <VirtualHost *> DocumentRoot "C:\xampp\htdocs" ServerName localhost </VirtualHost> <VirtualHost *> DocumentRoot "C:\Documents and Settings\Me\My Documents\clientABC\website" ServerName clientABC.local <Directory "C:\Documents and Settings\Me\My Documents\clientABC\website"> Order allow,deny Allow from all </Directory> </VirtualHost>
The first five lines of code turn on the Virtual Host feature on Apache, and set up the C:\xampp\htdocs folder as the default location for http://localhost. That’s important since you need to be able to access the XAMPP web pages at http://localhost/ so that you can use PHPMyAdmin.
The stuff in yellow represents a single Virtual Host. You’ll add one chunk of code just like this for each Virtual Host (or Web site) on your computer
You’ll need to modify the stuff highlighted in blue. The first item — DocumentRoot — indicates where the files for this site are located on your computer. The second part–ServerName — is the name you provided in step 2 above: the virtual host name. For example, clientABC.local. The third item — the <Directory> part — is the same path you provided for the DocumentRoot. This is required to let your Web browser have clearance to access these files.
- Save and close the Apache configuration file, and restart Apache from the XAMPP control panel.
- Start a Web browser and type a URL for the virtual host.
C:\xampp\apache\conf\extra\httpd-vhosts.conf
For example: http://clientABC.local/.You should now see the Main page for your site.
Labels:
Installation Php,
Xampp
Install XAMPP on Windows
Click to Download Xampp
Select the Installer option under the Basic Package. You may be taken to a page that presents you with a bunch of different download locations. Click one of the download buttons, and then save the file to your desktop. After Download, the installer works like most Windows installers.
Select the Installer option under the Basic Package. You may be taken to a page that presents you with a bunch of different download locations. Click one of the download buttons, and then save the file to your desktop. After Download, the installer works like most Windows installers.
A window opens, asking you to select the language you’d like to use.
If a warning dialog appears click the "Allow" option to install XAMPP.
A Setup Wizard window appears, ready to step you through the setup process.
In Vista you may see a message warning you that XAMPP may not work when installed in the C:\Program Files directory. The default installation is in C:\XAMPP so you don’t have to worry about this problem.
The installer suggests putting the application on your main drive at C:\XAMPP. You can install it anywhere, but with the Vista operating system you may encounter problems if you install in C:\Program Files.
The XAMPP Options window appears (see below). In most cases, it’s fine to leave all the window’s checkboxes just as you see; see the note below for details.
If you plan on doing a lot of development, day in and day out, you might want to turn on the “Install Apache as service” and “Install MySQL as service” checkboxes. A service starts up every time you turn on your computer, so Apache, PHP, and MySQL are always running. However, if you won’t be building database sites frequently, or you don’t have a lot of RAM in your computer, don’t turn on these boxes (you’ll just have to manually start the servers when you wish to build dynamic pages, using the XAMPP control panel described on the next page).
The installer places all the files onto your system. This process takes a while, since a lot of programs and files are being installed.
A window appears “congratulating” you (way to double-click the installer program!), and asking whether you wish to start the XAMPP Control panel.
The XAMPP Control Panel lets you start and stop the Apache Web server and MySQL database server.
In this snapshot, both Apache and MySQL are NOT running, as indicated by the word Start to the right of their names. Click the Start buttons to turn the servers on. You can open the Control Panel by clicking the XAMPP Control Panel shortcut on your desktop.
You probably get a Windows security alert about both MySQL and Apache: Click the Unblock button in both cases. This action allows the two servers to run, and tells the Windows firewall protection service that everything is OK.If Apache and MySQL are already running, these buttons say Stop. (Clicking them turns off the Web server and MySQL.) Whenever you start Apache, PHP automatically starts as well. At this point, you should have a complete testing server running on your machine. You just need to make sure it’s working.
You encounter a page that lists a bunch of languages; click the language you prefer, and you’re taken to a kind of Web-based control panel for XAMPP (see screenshot below).
Once installed, you can view your XAMPP home page from http://localhost/xampp/. From the left-hand list of links, you can access helpful programs and information, such as phpMyAdmin (for working with the MySQL database) and phpinfo() for finding out more about the server setup.
Once you’ve installed XAMPP, you’ll see a shortcut called XAMPP Control Panel on Desktop. Double-click this icon to control the servers you’ve just installed—you can turn the servers off and on, as well as turn them into services (which launch each time you start up your computer).
To Uninstall XAMPP :
Go to the location where you installed XAMPP (like C:\XAMPP\) and run the program named Uninstall.exe. This action, however, deletes any databases you created, and destroys any Web pages that you placed on the server.
To prevent this process, just follow these steps:
First, use phpMyAdmin to export any database you wish to save and then make a copy of your Web pages which are located in the C:\XAMPP\htdocs folder.
Labels:
Installation Php,
Xampp
How to Install PHP on Mac
Enable Apache on OS X
Before you can enable PHP on a Mac, you first have to enable Apache.This process is extremely easy.
That's it! If you want to test if it worked, point your browser to http://localhost/ and you should see the standard Apache test page.
- Click the 'System Preferences' icon in the Dock.
- Click the 'Sharing' icon in the Internet & Network section of the System Preferences window.
- Place a check mark in the ‘Web Sharing’ box.
That's it! If you want to test if it worked, point your browser to http://localhost/ and you should see the standard Apache test page.
Enabling the PHP Module on OS X
For this next part you are going to need a plain text editor that will allow you to open hidden files. TextWrangler because it's free and it gets the job done. These next steps might be slightly different if you are using a different editor, but the principle is still the same.
- We want to open the file located at HD:private:etc:apache2:httpd.conf. In TextWrangler we do this by choosing "Open Hidden" from the File menu.
- Since it is a root file, we need to unlock it before we can edit. In TextWrangler this is done by clicking the pencil button in the top left hand corner. You will get a pop-up confirming that you want to do this.
- Go to line 114, the line should read # LoadModule php5_module libexec/apache2/libphp5.so
- Delete the #, the line should now read LoadModule php5_module libexec/apache2/libphp5.so
- Save the file. You will be prompted for your password if you are using TextWrangler.
PHP Config
The next thing we want to do is make a copy of php.ini.default and save it as php.ini. Once we have done this we can edit our PHP preferences.
- First open up Terminal. It is located inside your Systems folder which is located inside your Applications folder.
- Enter the following lines, one at a time:
cd /private/etc sudo cp php.ini.default php.ini
- You may now open your new php.ini file using TextWrangler or another editing programing and change the default settings if you wish. It will be located in Macintosh HD:private:etc
Testing PHP
Finally we need to run a test to make sure that PHP is running.
You can restart Apache by entering the following line in Terminal:
Restarting will also require your password.
Congratulations, you have now activated PHP on your Mac, enjoy!
- First create a simple test file. A good thing to include is phpinfo().Sometimes it is necessary to find out more information about the version of PHP your server is running.
- If your PHP is working your test program should display your PHP's information. If it displays your code, you need to restart Apache.
You can find out the PHP version, as well as many specific settings just by running a very simple one line program from your browser. The phpinfo(); command will bring up a full profile of the PHP you are currently running, and display it in categorized tables for you to view.
You can restart Apache by entering the following line in Terminal:
sudo apachectl restart
Restarting will also require your password.
Congratulations, you have now activated PHP on your Mac, enjoy!
Labels:
Installation Php,
Xampp
How to Install Apache, PHP, MySQL and PHPMyAdmin in Ubuntu
If you are a PHP based web developer, you need all the software
running and configured properly. Here I am talking about installing them
One by One in your Ubuntu Desktop. We are installing all the
applications from terminalHow to Open Terminal:
So, to fire up the terminal follow any of these steps:
- If you are running Unity Desktop, click on the Ubuntu Logo at top left corner and type Terminal in the search application bar. Then click on the terminal icon.
- If you are running GNome Desktop, click on Applications->Accessories->Terminal
- For shortcut, you can also press Ctrl+Alt+T at once, to open the terminal.
1. Make sure you have the internet connection. To install apache execute the following command in the terminal:
sudo apt-get install apache2 |
How to Install PHP:
1. To install PHP 5, type following commands in the terminal one by one:
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5 |
2. After installing PHP5 and PHP module for apache, restart the apache with following code:
sudo /etc/init.d/apache2 restart |
sudo gedit /etc/apache2/conf.d/fqdn |
4. Now, we have successfully installed php and apache web server. However, still we don’t know if PHP is successfully installed. To check this, create a file inside /var/www/ folder named test.php as:
sudo gedit / var /www/test.php |
|
If you see the various information about PHP and installed modules there, then we can confirm that Apache is parsing PHP codes. Hence the installation is successful up to this point.
How to Install MySQL:
1. To install MySQL Server in ubuntu, type following code in terminal window:
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql |
How to Install PHPMyAdmin:
1. To Install PHPMyAdmin, type the following codes in the terminal:
sudo apt-get install phpmyadmin |
Once the installation completes, type this in your browser window to confirm the successful installation of PHPMyAdmin: http://localhost/phpmyadmin/index.php.
Now, you are finished. Your environment is setup and you can enjoy using all these applications. Next, you can install other applications that may be necessary such as Eclipse, GIMP etc.
Labels:
Installation Php,
Linux,
Xampp
install Xampp in ubuntu
Install Xampp in ubuntu
Xampp is an application that helps to run local server in your computer.It is a tedious method to install Apache web server add MYSQL, php, perl and other application. There xampp has all the stuff in one package. Therefore xampp make it easy to install all these package from a single application. Xampp is available for all the format including windows , mac and solaris. In compare to windows and mac the installation of xampp is a bit complicated in linux. If you are searching for lampp. you are in right place because xampp is previously called lampp. To begin the installation download xampp from official website. or download via terminal
Also see 4 ways of using wget command in Linux
After downloading place the file in desktop. Don’t extract the file. Put as you have downloaded it.
Step1: login into root directory
To install the xampp you have to log in into the root directory to log into root directory run the following command into terminal one by one
(Make sure the initial letter of Desktop is capital)
xampp ubuntu
Step2: Installing Xampp in Ubuntu
1. To install xampp in ubuntu run the following command in terminal which will extract the download file into /opt directory. Run the following Command in terminal
(Note: This version will install xampp 1.7.3 version Place the xampp-linux-1.7.3a with the version if you want to install another version).
This process will install xampp. You will find xampp in /opt/lampp. Directory.
Step 3: Solve htdocs trouble
After install xampp when you try to paste anything to htdocs you will get permission denied error. Therefore to fix this you have to run the following code in terminal after running the code you can simply put files and folder into htdocs
This changes the ownership of the htdocs folder to your user, the -R option makes the command recursive so all permissions of folders and files inside htdocs are changed aswell.
Step 4: How to operate xampp in ubuntu
In you can excess xampp with simple graphical interface but in linux you have to user terminal to start xamp. Here are the few guide for ubuntu user to operate xampp
1. To start Xampp
Run the following command in terminal to start lampp
xampp-ubuntu-start
2. Stop the Xampp
You can see further documentation on xampp page if you need more guide to operate xampp on linux
Xampp is an application that helps to run local server in your computer.It is a tedious method to install Apache web server add MYSQL, php, perl and other application. There xampp has all the stuff in one package. Therefore xampp make it easy to install all these package from a single application. Xampp is available for all the format including windows , mac and solaris. In compare to windows and mac the installation of xampp is a bit complicated in linux. If you are searching for lampp. you are in right place because xampp is previously called lampp. To begin the installation download xampp from official website. or download via terminal
wget http://www.apachefriends.org/download.php?xampp-linux-1.7.3a.tar.gz
Also see 4 ways of using wget command in Linux
After downloading place the file in desktop. Don’t extract the file. Put as you have downloaded it.
Step1: login into root directory
To install the xampp you have to log in into the root directory to log into root directory run the following command into terminal one by one
cd Desktop
(Make sure the initial letter of Desktop is capital)
sudo -s
xampp ubuntu
Step2: Installing Xampp in Ubuntu
1. To install xampp in ubuntu run the following command in terminal which will extract the download file into /opt directory. Run the following Command in terminal
tar xvfz xampp-linux-1.7.3a.tar.gz -C /opt
(Note: This version will install xampp 1.7.3 version Place the xampp-linux-1.7.3a with the version if you want to install another version).
This process will install xampp. You will find xampp in /opt/lampp. Directory.
Step 3: Solve htdocs trouble
After install xampp when you try to paste anything to htdocs you will get permission denied error. Therefore to fix this you have to run the following code in terminal after running the code you can simply put files and folder into htdocs
sudo chmod 777 -R /opt/lampp/htdocs/
This changes the ownership of the htdocs folder to your user, the -R option makes the command recursive so all permissions of folders and files inside htdocs are changed aswell.
Step 4: How to operate xampp in ubuntu
In you can excess xampp with simple graphical interface but in linux you have to user terminal to start xamp. Here are the few guide for ubuntu user to operate xampp
1. To start Xampp
Run the following command in terminal to start lampp
/opt/lampp/lampp start
xampp-ubuntu-start
2. Stop the Xampp
/opt/lampp/lampp stop
You can see further documentation on xampp page if you need more guide to operate xampp on linux
Labels:
Installation Php,
Linux,
Xampp
Subscribe to:
Posts (Atom)