Set php7 location to Apache (Macports) - apache

I've installed php7 via MacPorts to the El Capitan using this tutorial.
Is it possible to execute php7 with default OSX Apache (not Apache from MacPorts)? If yes, where should I set php7 location in Apache?

MacPorts will build all modules only for the Apache httpd provided by MacPorts itself and not for the system version.
See the notes for the php70-apache2handler port how you can enable the module:
$ port notes php70-apache2handler
php70-apache2handler has the following notes:
If this is your first install, you need to enable php70-apache2handler in your web server.
To enable php70-apache2handler, run:
cd /opt/local/apache2/modules
sudo /opt/local/apache2/bin/apxs -a -e -n php7 mod_php70.so

If someone had the same problem, this tutorial helped to solve my problem.

Related

Check the version of Apache web server on Suse Linux ES 12

does anyone know how I could check the version of apache2 web server on Linux Suse Enterprise Server 12?
I tried httpd -v and apache2 -v but those options don't work on this version of linux.
I would like to update the apache server, but unfortunately I have not worked with this version of linux until now.
Thanks in advance for your help.
Just check the installed rpm package by
rpm -q -i apache2
and also check the changelog of the package by
rpm -q --changelog apache2
because current security fixes are backported to the originally released version.

Mac OS Mojave downgrade PHP 7.3 to 7.2.14

I have installed PHP 7.2.14 with brew.
brew install php#7.2
On CLI I have already the 7.2.14 version, but not on Apache.
What should I do, so I can remove 7.3 from my Mac and use only 7.2.14
you need to run
brew link php#7.2
To force the link and overwrite all conflicting files:
brew link --overwrite php#7.2
To list all files that would be deleted:
brew link --overwrite --dry-run php#7.2
The PHP version in your CLI has nothing to do with the version you have on your Apache module.
You need to disable/enable the right modules in apache in order for the right php version to take affect.
For enabling/disabling a mod, you have this nice helper commands:
a2enmod <MOD_NAME> // Enable a mod
a2dismod <MOD_NAME> // Disable a mod
This one is not tested, but you should be able to do:
a2dismod php7.3
a2enmod php7.2
P.S
Not sure the apache helper commands are available in mac so you can do it directly through the httpd.conf file.
checkout /etc/apache2/httpd.conf and make sure the right modules are loaded.
Hope it helps.
Good luck :)

How to check LAMP is installed or not?

I am newbie in vps. I installed centos 6.5 64bit. one hour ago and installed Apache, php, mysql successfully. now I have to install phpmyadmin. It requires something called LAMP. I don't know if LAMP is already installed by default with centos or I have to manually install it. What is the ssh command to check it if LAMP installed or just answer yes or no.
UPDATE:
[understood]
That blogger confused me by separating LAMP with comma.
If LAMP was correctly installed, i.e., PATH is already set for php,mysql and apache2, then run following commands from terminal:-
php -v // Return PHP version
apache2 -v // Returns apache version
mysql --version // Returns mysql version
if all of the above command returns their respective versions, then it means LAMP is installed.
BUT if it doesn't then there might be two cases:-
1) LAMP might be installed but is not added to path.
2) LAMP is not installed, Install it.
As for the first case, if it is installed but not runnable from terminal, then just run following commands to see where LAMP components are installed:-
1) Find file with name "apache2" in your pc. It will return list of path where a file name called "apache2" exists. You can then cross examine it further.
sudo find / -name apache2
2) Run the above same command to find file "mysql" and follow the same procedure further.
sudo find / -name mysql
3) For PHP:-
sudo find / -name php
LAMP stands for Linux, apache, Mysql, PHP, if you've installed apache, mysql and PHP correctly on a linux system you have LAMP already set up.
If you want to check whether the above mentioned dependecies are installed or not
To check whether php is installed or not
php5 -v
For Apchae
/usr/sbin/apache2 -V
If any of the mentioned dependencies are not install and you want to install the LAMP use the following command,
sudo apt-get install lamp-server^

Apache Command Line Not Functioning

Installed Apache Ver 2.2.3 on my vps with Centos 5.6 but when I try the a2dismod and a2enmod got Command not found error.
What can I do to fix it?
Thank you
This is my first vps and this is also my first experience with linux and centos.
The server is running fine just need to disable few modules.
On CentOS there are no a2enmod and a2dismod commands. To disable unneeded modules in Apache, you need to carry out steps as described at the lower end of – for instance – this post: http://www.cyberciti.biz/faq/howto-disable-apache-modules-under-linux-unix/
Perhaps those commands were not in your path? If the programs are in your current working directory, try ./a2dismod.
To see what path our shell is searching, try echo $PATH.

Apache Response Time Monitoring in Hyperic

I seem to be having a hard time getting the Apache module for Hyperic to compile in Ubuntu 8.10. Has anyone had any luck getting it to work? Does anyone have a precompiled version?
I am running Hyperic HQ version 4.1.2 build #1053, Apache 2.2.x
I got it to work by doing the following:
Symbolically link aclocal and automake old hard coded version to your current version (replace version numbers 1.11 to your own):
sudo ln -s /usr/bin/aclocal-1.11 /usr/bin/aclocal-1.6
sudo ln -s /usr/bin/automake-1.11 /usr/bin/automake-1.6
Rename a conflicting header file:
sudo mv /usr/include/openssl/asn1.h /usr/include/openssl/asn_1.h
Run the installer:
sudo ./build_apache_snmp.sh -r 2.0 /usr/bin/apxs2
Once it is finished make sure you follow the directions located at ./README
Once you have confirmed that the SNMP service is working (using the snmpwalk application that the readme file refers to), reverse the steps above to revert system changes just needed to compile the plugin.