php repository is unavailable for Ubuntu-16.04 as per Dec 16, 2021. Need to add imap module - ubuntu-16.04

Ubuntu 16.04.06 with php7.0.33. I can only install php7.0-dev package.
Is it possible to compile php7.2.34-imap module using php7.0-dev package?
I downoladed php7.2.34 source, I'm in source/ext/imap/ directory and run
phpize
will it give the right ./configure file to compile 7.2.34-imap?
The server is in progress to be updated to Ubuntu 20.04 but it will take time and development is delayed.

I'm a newbie. I have never ever compiled any php source.
It took me a couple of days of testing to successfully compile php module and transfer it to a production server.
When php source is compiled php-dev is created as part of compiled version. There is a good example how to. https://askubuntu.com/questions/1102910/how-to-build-php-7-3
After compiling and installing php - compile a module. Good info is here: https://serverfault.com/questions/422010/add-module-to-custom-compiled-php
Transfer a module to another server: Manual Installation of php extension (copy from one server to another)

Related

Variant Effect Predictor | DBD mysql failing to setup

I trying to get set up with Variant Effect Predictor (VEP) on the command line. I'm following the setup tutorial but I'm encountering some errors around dependencies. I'm also quite new to the command line so if anyone is able to break down the solution too then I'd be very grateful. Thanks!
Tutorial: https://www.ensembl.org/info/docs/tools/vep/script/vep_tutorial.html
VEP requirements: http://www.ensembl.org/info/docs/tools/vep/script/vep_download.html#requirements
I also have Perl v5.32.1.
What I've done:
I installed dependencies (listed in the requirements page) with the following commands:
- sudo -s cpanm DBI
- sudo -s cpanm Archive::Zip
- sudo -s cpanm DBD::mysql
For DBD:mysql, I got the follwoing message:
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz ... OK
Configuring DBD-mysql-4.050 ... N/A
! Configure failed for DBD-mysql-4.050. See /root/.cpanm/work/1626111140.5937/build.log for details.
Trying it out anyway, I ran perl INSTALL.pl (from the tutorial page) and got the message below. I would like VEP to run in online mode too if possible.
`WARNING: DBD::mysql module not found. VEP can only run in offline (--offline) mode without DBD::mysql installed
http://www.ensembl.org/info/docs/tools/vep/script/vep_download.html#requirements
Hello! This installer is configured to install v104 of the Ensembl API for use by the VEP.
It will not affect any existing installations of the Ensembl API that you may have.
It will also download and install cache files from Ensembl's FTP server.
Checking for installed versions of the Ensembl API...done
Setting up directories
Destination directory ./Bio already exists.
Do you want to overwrite it (if updating VEP this is probably OK) (y/n)? y
- fetching BioPerl
- unpacking ./Bio/tmp/release-1-6-924.zip
ERROR: Unable to unpack file ./Bio/tmp/release-1-6-924.zip without Archive::Extract or tar/unzip/gzip`
You show us this error:
Configure failed for DBD-mysql-4.050. See /root/.cpanm/work/1626111140.5937/build.log for details.
So looking in there will give you more clues about what the problems are. Without that, we can only guess.
But we can make educated guesses. The DBD::mysql distribution comes with a file called DBD::mysql::INSTALL which will talk you through some of the problems you'll find while installing this module.
It's important to note that DBD::mysql is a wrapper around MySQL's client libraries. They are written in C, so you'll need a C compiler installed in order to build DBD::mysql. You'll also need the client libraries and the development versions of the client libraries (for the C header files that you'll need to compile the module). On Ubuntu, those packages are called "libmysqlclient" and "libmysqlclient-dev". If you don't have a C compiler, then you'll want to install "gcc" too.
But this is all getting a bit complicated. There's another, simpler, approach. If you're using the system version of Perl (the version that was installed as part of the operating system and probably lives in /usr/bin/perl) then I'd recommend using the pre-build Ubuntu version of the package, which you can install by running:
$ sudo apt-get install libdbd-mysql-perl
Installing that version uses the OS's own package manager, and the package manager knows which other packages are needed in order for it to work - so it will install those as well.
People will probably complain that you're better off installing the modules from CPAN as it gives you more flexibility and allows you to use more up-to-date packages than the versions from your OS repos. And they're right. But, honestly, if you're a non-Perl programmer who just wants to get an application up and running, this is by far the simplest approach.
(But, as I said above, this is all guesswork as you haven't shared the most important errors with us.)

How to create and compile a custom module in MongooseIM

System Info:
MongooseIM version: 3.0.0
Installed from: pkg
Erlang/OTP version: 18
Ubuntu 16.04
I am having trouble creating a standard base for a custom module. I want to create a simple hello world program as outlined in the documentation for ejabberd.
However, I cannot get it to work for MongooseIM. Are there any instructions for how to do this? As a beginner I am just looking for building blocks to creating my own modules, and everything I look at is a little too complex for what I am trying to achieve at the moment.
Here is the code for my module: (taken from ejabberd) https://docs.ejabberd.im/developer/extending-ejabberd/modules/#mod-hello-world
And here is my log error:
I have added the following line in my config file with all other running modules:
{mod_hello_world, []}
I am assuming it has something to do with the compilation and there being no .beam file created for the modules as well as some syntax errors specific to MongooseIM. I am also unfamiliar with documentation for compiling modules when using a pre-built pkg as opposed to installing from source.
DISCLAIMER: I'm a MongooseIM developer working for Erlang Solutions.
The link you posted hints at the answer to the immediate question:
If you compiled ejabberd from source code, you can copy that source code file with all the other ejabberd source code files, so it will be compiled and installed with them. If you installed some compiled ejabberd package, you can create your own module dir, see Managing Your Own Modules.
MongooseIM (a.k.a. MIM) does not support the latter method of managing modules, i.e. it's not possible to drop source code into some predefined location when MIM is installed from a package and let it just compile and run the module. If we want to write a custom module, we have to build MongooseIM from source.
To be precise, we don't have to build the whole server from source and package it ourselves. We have to, however, clone the repository, place the new module source there (due to build time requirements like header files) and build it there. Once we get a .beam file of the new module we can just drop it into an installed MongooseIM's code path.
To be even more precise, let's say we have installed MIM from mongooseim_3.0.0-1~ubuntu~artful_amd64.deb available from the Downloads page at erlang-solutions.com, therefore we want to build a module compatible with 3.0.0:
Clone MIM: git clone https://github.com/esl/mongooseim
cd mongooseim
git checkout 3.0.0
Place mod_hello_world.erl under ./src/
rebar3 compile
Once rebar3 finishes get ./_build/default/lib/mongooseim/mod_hello_world.beam and copy to the target host where we installed MIM from a package.
Please note, though, that an example taken straight from ejabberd documentation might not work "as is" in MongooseIM. In this simple module, for example, we'll not be able to include logger.hrl as MongooseIM doesn't have such a header file - we would have to -include("mongoose_logger.hrl"). instead.

Problems installing/compiling DBD::mysql on OpenSuSE 10

I am getting a bunch of compile errors when I try to install the MySQL DBD::mysql Perl library. I am trying to install this library on OpenSuse linux (SUSE Linux Enterprise server 10 (x86_64) version 10, patch level 4)
The install fails when trying to compile dbdimp.h. There are hundreds of complile errors but I have reason to believe they all stem from the first 3:
dbdimp.h:23:49: error: mysql.h: No such file or directory
dbdimp.h:24:45: error: mysqld_error.h: No such file or directory
dbdimp.h:26:49: error: errmsg.h: No such file or directory
I believe that the reason I am getting the errors above is that I have no MySql Client installed. I do not know how to install mysql client (I believe I am supposed to get some version of libmysqlclient).
I am brand new to opensuse and vaguely familar with installing packages on Linux in general have used yum, yast, apt-get on ubuntu + centOS previously but the only package manager tools that seem to be on OpenSuse 10 are rpm and zypper. I have not managed to install the required mysql client using either of these. If anyone knows how to install MySql Client to resolve my issue I would greatly appreciate any recomendations
Thanks
You need to install MySQL or the MySQL client libraries, either through your system's package manager or by following the installation instructions from the source code.
It sounds like your question is really "How do I install MySQL on OpenSuse", which would be more appropriate for one of the other StackExchange sites.
I was able to resolve this to a point. In my original question, I stated that I had tried using YAST but that it had not worked. In fact, I did not fully explore the YAST install option but when I did, I managed to download install the required librarys by following an article I found (http://adminramble.com/install-mysql-yast/#chitika_close_button)
I was able to open the YAST GUI in the terminal window (not an X-window display) and navigate through the "software management" section wherein I was able to do a search for MySql. Amoung the search results were mysql client libraries, which I then selected and hit "Accept". The installation started and completed successully.
In order to complile the PERL DBD::mysql module, I had to create a new makefile with the ccflags specified so that the header files could be found:
perl Makefile.PL --cflags -I/usr/include/mysql
I say "to a point" at the top of this comment because I then ran into further problems compiling but my original issue posted has been partially resolved and getting this far may help someone else who is experiencing the same problem. Will update if I get a solution to the compile problem.

Installing Go on CentOS 5.x

I want to install Go on CentOS 5.x, but Go website here http://golang.org/doc/install mentions that it is not supported.
Is there still some way to install Go Language on CentOS since CentOS is just a different flavour of Linux?
When I installed the same and ran the sample program hello.go mentioned at above website
I got the error
hello.go:3:8: import "fmt": cannot find package
package runtime: import "runtime": cannot find package
% export GOROOT=~/
% go run test.go
test.go:3:8: import "fmt": cannot find package
package runtime: import "runtime": cannot find package
Not finding the "runtime" package tells you that the $GOROOT enviroment variable isn't set to golang root directory.
You need to set $GOROOT. Also you should set the $GOPATH variable if you use external packages (go help gopath for more information).
A typical setup (not specific to CentOS) would be:
export GOROOT="/usr/local/go"
export PATH="$GOROOT/bin:$PATH"
export GOPATH=/Users/rodowi/gocode
At least for some programs it works fine. I have a production program that I compile on RHEL 6.x and deploy on 5.x and 6.x and it is working without any problems.
Edit: I used to use it under 1.0.3, but a few months ago I upgraded to "tip go" (the soon to be 1.1 version). Under 1.x it'd crash on 5.9 when accepting a tcp connection but that was fixed a few days after I reported it on the mailing list.
http://dave.cheney.net/2013/06/18/how-to-install-go-1-1-on-centos-5
This page explains rather well what kernel primitives are missing from the CentOS-5 kernel, their impact, and possible fixes.
I'm affraid you're out of luck because of the bit too much aged kernel version of CentOS 5.x. If the go runtime uses features simply not present in that kernel, then I see no easy way how it could work.
you could download the rpm package and begin installing locally, check below and download according to your OS:
http://pkgs.org/download/golang
or you could alternatively compile and build from source:
http://dave.cheney.net/2013/06/18/how-to-install-go-1-1-on-centos-5

memcache install for MAMP using wrong API version

I'm attempting to install memcache for MAMP. It seems to configure/make/install fine but I'm getting an error saying the API version is wrong:
[26-Oct-2012 17:40:51 UTC] PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0
I am using MAMP 2.1.1 on OS X Mountain Lion.
I'm using this memcache build:
http://pecl.php.net/package/memcache/2.2.7
I extracted the archive into this directory:
/Applications/MAMP/bin/php/php5.4.4/include/memcache-2.2.7
And then ran these commands from the extracted directory:
/Applications/MAMP/bin/php/php5.4.4/bin/phpize
./configure
make
sudo make install
No errors except what I noted above, which I am seeing in:
/Applications/MAMP/logs/php_error.log
Any ideas on how to fix this?
Ok so after a few hours of trying to figure this out, I was able to find the problem and fix it. I'm pretty much a huge noob when it comes to all of this stuff, but here is the best I can explain what I think I figured out:
So, when I ran first ran phpize on the module, it was configured for my system's default installation of php. I had to point php and phpize to my PATH in my .bash_profile
export PATH=/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php5.4.3/bin:/usr/local/bin:$PATH:/opt/local/bin
Make sure to change the php version to what ever version you are running.
After adding this to your path, running phpize -v should return:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
and running which phpize should return: /Applications/MAMP/bin/php/php5.4.3/bin/phpize
So then it was just a matter of deleting all of the files that were installed the first time, and running through the installation process again. I unzipped the downloaded file cd into the unzipped folder and ran:
/Applications/MAMP/bin/php/php5.4.3/bin/phpize
./configure
make
cp modules/memcache.so /Applications/MAMP/bin/php/php5.4.3/lib/php/extensions/no-debug-non-zts-20100525/
And boom done. It works!
This article helped me out a lot, even though it isn't related to memcache: http://drupal.org/node/1464236