Php-gd: PHP Extension gd must be loaded & Unable to locate package - php-gd

Having an issue with php-gd
I inserted this command:
sudo apt-get install php5-curl php5-mcrypt php5-gd php5-common
throughout the process to setup Magento but when I went through Validation, this is what I got:
"PHP Extension gd must be loaded"
When the warning showed up. I tried to install it again using:
sudo apt-get install php5-gd
This was the message that I received:
"Reading package lists... Done E: Unable to locate package"
I Would like some direction on how to fix this Error.

Restarting the webserver after installing php5-gd loads the package.

check. reloading the web server. services such as php-pfm (php5-fpm), fcgi, fastcgi, etc load once and remain in the background. Adding modules does not impact the running copy. It must be restarted to load the module into active use.

Use synaptic package manager for easier installation.
After installing and it still does not work, look at the apache modules, mine is at /etc/php5/apache2/conf.d/20-gd.ini
; configuration for php GD module
; priority=20
; extension=gd.so
Even if the module exists and is installed on the system, it is commented out on the module config. Uncomment it, then restart Apache, then you should be fine.

Related

How install memcached in Mac Bigsur with PHP 7.3 and home brew

I am working on a project with setup PHP7.3, Drupal 6.4 with memcached. Memcached is working in server and in my local machine with windows. But I am not able to make it work in my Mac machine. I followed the below link to make this work.
https://www.journaldev.com/1/install-memcached-mac
And I tried
brew install memcached
Also.
Then added
[memcached]
extension="memcached.so"
In php.ini file. Then restarted apache. After this on the first run I got the error
{"Error Details":{"Message":"\n Error code : 32\n Message : PHP Startup: Unable to load dynamic library 'memcached.so' (tried: /usr/local/lib/php/pecl/20180731/memcached.so (dlopen(/usr/local/lib/php/pecl/20180731/memcached.so, 9): image not found), /usr/local/lib/php/pecl/20180731/memcached.so.so (dlopen(/usr/local/lib/php/pecl/20180731/memcached.so.so, 9): image not found))\n File name : Unknown\n Line no : 0\n Date :12-March-21 02:45:05\n Path : http://localhost/mysite/?q="}}
But from the second run onwards the error is not there. But memcache is not working. And I can't find the memcached.so file in my system.
How can I fix this? Please help
I tried this. It helps.
https://izziswift.com/how-to-install-memcached-module-for-php7-1-on-macos-high-sierra/
pecl bundle memcached
Change to the directory it output.
phpize
Make sure libmemcached and zlib are installed (brew install libmemcached zlib).
Get the zlib directory (brew list zlib).
./configure --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11/ (replace the zlib path with the one from the previous command).
make
make install
Add the extension line in your php.ini file (ex. change the paths to match what make install output. I added this to my /usr/local/etc/php/7.4/conf.d directory in a file called ext-memcached.ini.
[memcached]
extension=memcached.so
Verify you installed the module php -m should show you memcached in the outputted list.
Have you remembered to start the service?
brew services start memcached

Homebrew PHP Install Breaks Apache 2.4

When I recently installed PHP56 via Homebrew, Apache would no longer start, with this error in the logs:
Cannot load /usr/local/opt/php56/libexec/apache2/libphp5.so into server: dlopen(/usr/local/opt/php56/libexec/apache2/libphp5.so, 10): image not found
Note: I'm running Apache 2.4 on Mac El-Capitan.
How can I resolve this error and get Apache running again?
I've seen this before. If you brew options php56, it says:
With the release of macOS Sierra the Apache module is now not built by default. If you want to build it on your system
you have to install php with the --with-apache option. See brew options php56 for more details.
Thus, try uninstalling (brew uninstall php56) then reinstalling php56 with the flag --with-apache for Apache v2.4.x (--with-apache22 for Apache 2.2). Generally, you can check your Apache version by typing in command line: httpd -v.
My version is 2.4.18, so I would brew install php56 --with-apache, which creates the proper file path /usr/local/opt/php56/libexec/apache2/libphp5.so.
Now, it is properly compiled with Apache Handler module.
IMPORTANT: installing php56 with this option appears to also install httpd24. From a brew program stance, this makes sense. However, this may break your server set up. If you don't want to use brew's Apache install, do a brew unlink httpd24 after this.
To see additional brew build options, try brew options php56.

Not able to install mod_perl module on the server

In my site I am getting an error : an error occurred while processing this directive
It was working fine before moving to the new server. So when I checked I found that mod_perl module is missing. So I tried to install it by downloading the module to the server and then tried to run using Perl Makefile.pl but it was asking for apache src and I was not able to find it. I can see /usr/bin/apache/ folder but no source file inside the folder.
So I tried to install the module from Cpanel but I got the following error:
The C compiler is not functional and auto repair failed. Perl module installs require a working C compiler. Please repair the C compiler and try again.
Please let me know how to install it as I have tried most of the cases searching the net.
Thanks in advance
It's probably best to use your distro's packaging system to install mod_perl, especially, if apache is installed from a package too.
Yum based systems:
yum install mod_perl
Deb based systems
apt-get install mod_perl
you may need to enable the module using a2enmod
Mostly gcc is either corrupted or not present on your system. Please try to re/install gcc on your system
sudo apt-get update
sudo apt-get install build-essential
On Redhat:
yum update
yum install devtoolset-2-toolchain
It seems like a problem with your installation of gcc. You're using CloudLinux, so you should use yum to reinstall gcc.
$ sudo -i yum install gcc
But you don't need gcc if you install the pre-build packages.
$ sudo -i yum install mod_perl
Either way, you're going to need to get to grips with package installation for your system - and for that you're going to need root access.

Install module with puppet

Trying to install the module vcsrepo with puppet, but really unsure how it could be done. The commandline to install it is:
puppet module install puppetlabs-vcsrepo
Tried to install it this way, but that didn't work:
package { 'vcsrepo':
ensure => installed,
}
It'd be really helpful to see the error output of the first command as that IS the way one installs a Puppet module. If I had to guess, it probably errored out saying something like /home/yourusername/.puppet/ does not exist - by default, when ran by a regular user, puppet install will attempt to download the module into .puppet/modules in that user's home directory. Running sudo puppet module install module-name though by default would install the module system-wide into /etc/puppet/modules.

(httpd) Getting some problems with Mod_security Installation

I'm using Webuzo on my first unmanaged VPS (CentOS 6.4,OpenVZ). I tried to install Mod_Security following this guide. I installed Modsecurity-apache_2.6.6 but there's a problem in Step3 that prevents me from installing OWASP Mod_Security Core Rule Set
wget http://www.modsecurity.org/download/modsecurity-apache_2.6.6.tar.gz
The Download address has been removed. So I found another guide for the rule set but I can't get this command to work
git clone https://github.com/SpiderLabs/owasp-modsecurity-crs.git
It returns "-bash: git: command not found"
What command should I use to get OWASP CRS?
Also, I suspect the mod_security installation is incomplete since httpd server is unable to restart after installing modsecurity. Here's the configuration error:
[root#xx ~]# httpd -t
Syntax error on line 7 of /etc/httpd/conf.d/modsecurity.conf:
Invalid command 'SecRuleEngine', perhaps misspelled or defined by a module not included in the server configuration
Should I uninstall Mod_Secuirty first since everything seems to have become a mess now?
Any help is appreciated.
The apache binary in case of Webuzo is located at /usr/local/apps/apache and the modules are located at /usr/local/apps/apache/modules/lib.
Also the apache configurations in case of Webuzo are located at /usr/local/apps/apache/etc/ and /usr/local/apps/apache/etc/conf.d/
It seems you are trying to compile mod_security at an inappropriate location.
As you are having error with modsecurity.conf, I wonder whether you have followed the step
Step 4: Configuring Mod_Security
In the guide you have followed.
"-bash: git: command not found"
This error can be resolved by installing the package that includes git. try
yum install git-core -y
Both guide1 and guide2 are good to install mod_sec and follow any one. :)