I'd like to know how can I reinstall PHP via dnf and make it default for apache. My problem is that I have a installed version of PHP but it was compiled and as I'm facing several problems with modules I didn't compile I thought it'd be easier do it this way. I'd like to remove this version that's installed too.
Here it's the result of how it's working on my machine right now:
$ uname -a
Linux dev 4.4.6-200.fc22.x86_64 #1 SMP Wed Mar 16 22:13:40 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ httpd -v
Server version: Apache/2.4.18 (Fedora)
Server built: Jan 4 2016 13:05:47
$ php -v
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/php-5.6.19/lib/php/extensions/no-debug-non-zts-20131226/zip.so' - /opt/php-5.6.19/lib/php/extensions/no-debug-non-zts-20131226/zip.so: undefined symbol: executor_globals_id in Unknown on line 0
PHP 5.6.19 (cli) (built: Mar 17 2016 10:26:07)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
I'm just asking because I wasn't able to find how to do that here or several other places I've searched. Tks in advance.
Related
I am following the instructions here to install the Filerun app on my Nginx server, running on Ubuntu / Raspberry Pi 4.
I downloaded the aarch64 version of IonCube and created a file /etc/php/7.4/fpm/conf.d/00-ioncube.ini with contents
zend_extension = /usr/lib/php/ioncube/ioncube_loader_lin_7.4.so
I verified that the referenced so file exists.
I then ran sudo systemctl restart php7.4-fpm and it shows that the service is running.
But when I do php -v I don't see IonCube mentioned:
$ php --version
PHP 7.4.33 (cli) (built: Nov 8 2022 11:40:37) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
And when I visit the actual site I get an error saying:
Site error: the ionCube PHP Loader needs to be installed.
I had the wrong version of IonCube. You can run php -i | head -5 to see the architecture:
phpinfo()
PHP Version => 7.4.33
System => Linux raspberrypi 5.15.76-v7l+ #1597 SMP Fri Nov 4 12:14:58 GMT 2022 armv7l
Build Date => Nov 8 2022 11:40:3
In my case it's armv7l (I was wrong to think it was aarch64).
Downloading the correct version from here solved the problem https://www.ioncube.com/loaders.php
I was following instructions to install get to clone a repository and then all of the sudden I started getting "bin/magento must be run as a CLI application" error.
When I did php -v, it shows:
ea-php-cli Copyright 2016 cPanel, Inc.
PHP 7.0.17 (cgi-fcgi) (built: Apr 5 2017 23:22:19)
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.17, Copyright (c) 1999-2017, by Zend Technologies
I've sincerely searched for hours to change this back to show (cli), but so far no luck.
I've reinstalled ea-php-cli via yum but nothing has changed.
When I stopped and restarted the httpd, I get a bunch of errors like this one:
[alias:warn] [pid 31484] AH00671: The ScriptAlias directive in
/etc/apache2/conf/httpd.conf at line 645 will probably never match
because it overlaps an earlier ScriptAlias.
Does anyone know the command to change the php mode to cli mode rather than cgi-fcgi mode? If not, do I need to uninstall and reinstall php?
Update
so after some research I realized that it has to do with the Server API where it's set up as FPM/FAstCGI rather than Apache 2.0 Handler. I will have to research this and then find out how to switch the server API back to Apache Handler... I'm running Centos 6.9 so if anyone has an easy solution, I'd greatly appreciate your input.
More Update
The only thing I can think of that may have affected the Server API to switch is a few of the patches I have made. Here's a list of all the patches and changes made to the server today:
Apr 15 12:47:02 Installed: kernel-2.6.32-696.1.1.el6.x86_64
Apr 15 13:14:02 Installed: 1:perl-Error-0.17015-4.el6.noarch
Apr 15 13:14:02 Installed: perl-Git-1.7.1-8.el6.noarch
Apr 15 13:14:03 Installed: git-1.7.1-8.el6.x86_64
Apr 15 19:21:49 Erased: epel-release
Apr 15 20:33:45 Installed: ea-php-cli-0.2.0-1.1.1.cpanel.x86_64
Apr 15 21:00:58 Installed: ea-php-cli-0.2.0-1.1.1.cpanel.x86_64
Apr 15 22:32:44 Installed: ea-php-cli-0.2.0-1.1.1.cpanel.x86_64
After 15 hours of searching for an answer, I finally got it resolved.
Simply add source /opt/cpanel/ea-php70/enable to /etc/bashrc and php -v results in showing cli.
PHP 7.0.17 (cli) (built: Apr 5 2017 23:21:59) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.17, Copyright (c) 1999-2017, by Zend Technologies
I just installed a fresh ubuntu system from here (mini.iso)
I choosed no extras at all during the installation process.
These are all the commands which I have executed this far:
(Ignore 4 - 8)
Now I wrote a simple PHP test script (/var/www/html/index.php)
<?php
echo "Hello World";
?>
However, after calling this page from another computer, I literally get the output from the file, instead of the compiled php.
Output:
<?php
echo "Hello World";
?>
I have already restarted apache2, no change.
Apache version:
Server version: Apache/2.4.7 (Ubuntu)
Server built: Jul 15 2016 15:32:47
PHP version:
PHP 7.0.16-4+deb.sury.org~trusty+1 (cli) (built: Mar 2 2017 13:50:00) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.16-4+deb.sury.org~trusty+1, Copyright (c) 1999-2017, by Zend Technologies
Linux version:
Linux linux 3.13.0-110-generic #157-Ubuntu SMP Mon Feb 20 11:55:25 UTC 2017 i686 i686 i686 GNU/Linux
I already searched the internet, some other user sayed to check if the PHP module is loaded by checking the file httpd.conf, but there is no such file. I searched it by using find / -name "httpd.conf" which gave no results.
You need to install PHP apache2 module to work with PHP. You can install libapache2-mod-php from your terminal by typing the command
sudo apt-get install libapache2-mod-php
After that restart your apache. It will solve your problem.
I am running CentOS release 6.4 (Final). I removed php 5.2.17 via yum and installed php 5.3.3. via yum as well. Since then Apache can't write to files. I've got error:
failed to open stream: Permission denied
phpinfo() says:
Server API CGI/FastCGI
Details:
PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
Server version: Apache/2.2.15 (Unix)
Server built: Aug 13 2013 17:29:28
Any ideas?
Many thanks
check that the user that is running your apache has the necessary access rights to read the directory and file
Mac OS X 10.8.5. I am trying to get Netbeans running using xdebug. To date I have tried XAMPP and MAMP without success. Apparently there is a native PHP on the Mac that I can't figure out how to remove:
sh-3.2# which php
/usr/bin/php
sh-3.2# php -v
PHP 5.3.26 (cli) (built: Jul 7 2013 19:05:08)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
However, the PHP in my MAMP installation shows:
sh-3.2# pwd
/Applications/MAMP/bin/php/php5.5.3/bin
sh-3.2# ./php -v
PHP 5.5.3 (cli) (built: Sep 18 2013 14:31:13)
I followed the instructions on this page:
https://netbeans.org/kb/docs/php/configure-php-environment-mac-os.html
but xdebug does not show up in the list of extensions on the phpinfo page. I downloaded the latest xdebug by the way (2.2.3). I've also tried the tailored instructions here: http://xdebug.org/wizard.php with no luck.
I'm certain it's because if the mismatched php's. How do I remove the native PHP to get this working?
Thanks!
Roberto