How to start the php after yum installed?


How to start the php after yum installed?



After I use yum installed the php7.0:


yum


php7.0


yum install php70w



now how to start it?


# whereis php
php: /usr/bin/php /usr/lib64/php /etc/php.d /etc/php.ini /usr/local/bin/php /usr/share/php /usr/share/man/man1/php.1.gz



I also can not find the php-fpm:
# find / -name php-fpm


php-fpm



I installed apache, in /usr/local/httpd/.


/usr/local/httpd/



EDIT-1


# yum install php7.0 libapache2-mod-php7.0
loaded:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* epel: mirror.premi.st
* extras: mirrors.163.com
* updates: mirrors.163.com
* webtatic: sp.repo.webtatic.com
No package php7.0
No package libapache2-mod-php7.0
Error: there is no ..





You can either execute PHP scripts directly: /usr/bin/php /path/to/script.php or, you will need a webserver with the PHP7 module also installed. Either nginx or apache.
– Matt Clark
Jul 3 at 3:44


/usr/bin/php /path/to/script.php





I installed apache.
– qg_java_17137
Jul 3 at 3:47





Great, now install the PHP modules: apt-get install libapache2-mod-php7.0 then restart the httpd.
– Matt Clark
Jul 3 at 3:48



apt-get install libapache2-mod-php7.0





I use yum can not install install php7.0 libapache2-mod-php7.0. see my edit.
– qg_java_17137
Jul 3 at 3:49



install php7.0 libapache2-mod-php7.0





Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See What topics can I ask about here in the Help Center. Perhaps Super User or Unix & Linux Stack Exchange would be a better place to ask.
– jww
Jul 3 at 11:46




1 Answer
1



First To see the available options for PHP modules and libraries, you can type this into your system:


sudo yum search php-



The results are all optional components that you can install. It will give you a short description for each:


php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
php-cli.x86_64 : Command-line interface for PHP
php-common.x86_64 : Common files for PHP
php-dba.x86_64 : A database abstraction layer module for PHP applications
php-devel.x86_64 : Files needed for building PHP extensions
php-embedded.x86_64 : PHP library for embedding in applications
php-enchant.x86_64 : Enchant spelling extension for PHP applications
php-fpm.x86_64 : PHP FastCGI Process Manager
php-gd.x86_64 : A module for PHP applications for using the gd graphics library
. . .



To get more information about what each module does, you can either search the internet, or you can look at the long description in the package by typing:


yum info package_name



There will be a lot of output, with one field called Description which will have a longer explanation of the functionality that the module provides.



For example, to find out what the php-fpm module does, we could type this:


sudo yum info php-fpm



Along with a large amount of other information, you'll find something that looks like this:


. . .
Summary : PHP FastCGI Process Manager
URL : http://www.php.net/
License : PHP and Zend and BSD
Description : PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI
: implementation with some additional features useful for sites of
: any size, especially busier sites.



If, after researching, you decide you would like to install a package, you can do so by using the yum install command like we have been doing for our other software.



If we decided that php-fpm is something that we need, we could type:


sudo yum install php-fpm



If you want to install more than one module, you can do that by listing each one, separated by a space, following the yum install command, like this:


sudo yum install package1 package2 ...



At this point, your LAMP stack is installed and configured. We should still test out our PHP though.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

api-platform.com Unable to generate an IRI for the item of type

How to set up datasource with Spring for HikariCP?

Display dokan vendor name on Woocommerce single product pages