Ubuntu Server Guide Changes, errors and bugs
Download 1.27 Mb. Pdf ko'rish
|
ubuntu-server-guide
- Bu sahifa navigatsiya:
- Configuration
- Ruby on Rails
- Installation
Installation
PHP is available in Ubuntu Linux. Unlike Python, which is installed in the base system, PHP must be added. To install PHP and the Apache PHP module you can enter the following command at a terminal prompt: sudo apt i n s t a l l php l i b a p a c h e 2 −mod−php You can run PHP scripts at a terminal prompt. To run PHP scripts at a terminal prompt you should install the php-cli package. To install php-cli you can enter the following command: sudo apt i n s t a l l php− c l i You can also execute PHP scripts without installing the Apache PHP module. To accomplish this, you should install the php-cgi package via this command: sudo apt i n s t a l l php−c g i To use MySQL with PHP you should install the php-mysql package, like so: sudo apt i n s t a l l php−mysql Similarly, to use PostgreSQL with PHP you should install the php-pgsql package: sudo apt i n s t a l l php−p g s q l 300 Configuration If you have installed the libapache2-mod-php or php-cgi packages, you can run PHP scripts from your web browser. If you have installed the php-cli package, you can run PHP scripts at a terminal prompt. By default, when libapache2-mod-php is installed, the Apache 2 Web server is configured to run PHP scripts using this module. Please verify if the files /etc/apache2/mods−enabled/php7.*.conf and /etc/apache2 /mods−enabled/php7.*.load exist. If they do not exist, you can enable the module using the a2enmod command. Once you have installed the PHP related packages and enabled the Apache PHP module, you should restart the Apache2 Web server to run PHP scripts, by running the following command: sudo s y s t e m c t l r e s t a r t apache2 . s e r v i c e Testing To verify your installation, you can run the following PHP phpinfo script: p h p i n f o ( ) ; ?> You can save the content in a file phpinfo.php and place it under the DocumentRoot directory of the Apache2 Web server. Pointing your browser to http://hostname/phpinfo.php will display the values of various PHP configuration parameters. References • For more in depth information see the php.net documentation. • There are a plethora of books on PHP. A good book from O’Reilly is Learning PHP, which includes an exploration of PHP 7’s enhancements to the language. PHP Cook Book, 3rd Edition is also good, but has not yet been updated for PHP 7. • Also, see the Apache MySQL PHP Ubuntu Wiki page for more information. Ruby on Rails Ruby on Rails is an open source web framework for developing database backed web applications. It is optimized for sustainable productivity of the programmer since it lets the programmer to write code by favouring convention over configuration. Installation Before installing Rails you should install Apache (or a preferred web server) and a database service such as MySQL. To install the Apache package, please refer to HTTPD - Apache2 Web Server. For instructions on installing and configuring a database service refer to MySQL documentation for example. Once you have a web server (e.g. Apache) and a database service (e.g. MySQL) installed and configured, you are ready to install Ruby on Rails package. To install the Ruby base packages and Ruby on Rails, you can enter the following command in the terminal prompt: 301 |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling