The Zip PHP extension is now required by Moodle - zip

i need help.i got this error The Zip PHP extension is now required by Moodle, info-ZIP binaries or PclZip library are not used anymore. while installing moodle on my server.
i enabled extension zip in configuration php but no result.!!!
Help Please!

Ubuntu 16.04 php7 Moodle 3.0 installation
apt-get install php-zip
:/usr/bin# ./php-config --with-apxs2=/usr/sbin/apxs --enable-mbstring --with mysql=/usr --with-pear --enable-sockets --with-gd --with-jpeg-dir=/usr --with-ttf --with-freetype-dir=/usr --with-zlib-dir=/usr --with-iconv --with-curl --with-openssl --with-mysqli --enable-soap --with-xmlrpc --enable-zip
service apache2 restart
Notes:
(:/usr/bin# ./php-config --enable-zip might have been enough, but I ran the whole command, just in case.)
Do not add the extension in the php.ini file. The installation automatically creates a 20-zip.ini file in /etc/php/7.0/apahce2/conf.d folder with the extension enabled

Found some instructions here - https://docs.moodle.org/28/en/admin/environment/php_extension/zip
This is a copy of the above :
The native PHP zip extension is required to let Moodle 2 read or write ZIP compressed archives.
Native installations of php will need php zip library enabling by adding the line
extension=zip.so
to php.ini
However if your php was not compiled with the extension then...
Installation on Linux Systems
If your distribution doesn't include this extension by default, then you need to compile PHP yourself and include --enable-zip.
This general PHP configuration will work well with Moodle 2.0:
./configure --with-apxs2=/usr/sbin/apxs --enable-mbstring --with mysql=/usr --with-pear --enable-sockets --with-gd --with-jpeg-dir=/usr --with-ttf --with-freetype-dir=/usr --with-zlib-dir=/usr --with-iconv --with-curl --with-openssl --with-mysqli --enable-soap --with-xmlrpc --enable-zip
Installation on Windows Systems
Uncomment this line in your php.ini:
extension=php_zip.dll
Note: The Zip extension is built-in since PHP 5.3.x on Windows. The above php.ini line and the corresponding dll file is not required if using the distribution from windows.php.net. Not verified on other distributions on other OSs.

Simply Use:
sudo apt-get install php-zip
Then you must restart Apache Service, Use:
sudo service apache2 restart

Related

How do I package an application for ubuntu apt-get?

I want to host an apt-get repository.
How do I package my application, and how do I host it in a repository for use?
The application relies on Java, MySQL, upstart and is configured to run on boot as an upstart service.
The answer should also include, how to host the package on a repository.
Ref:
How do I package a Java program for Ubuntu?
How do I package Mono applications for Debian/Ubuntu
Packaging for Ubuntu - Web Application
Good question, maybe a personal ppa is what you are looking for. After you finish you will have to do a $ sudo add-apt-repository ppa:myApp/ppa. Then you can apt-get install it.
To package your application you will need to do this in your apps directory
myappFolder$ dh_make -p myApp_1.0 --createorig
To create a original tar of your app. This will also create a Debian folder with a control file, a rules file, changelog... Change the values in these files to fit how your package should be. Specifically the control file. You will have a Depends: field where you can write in packages your application relies on such as Java and MySQL, make sure to have the same names as Ubuntu repository for these things.
goodLink https://www.debian.org/doc/manuals/maint-guide/dreq.en.html
Check out chapter 5 the install file and then building the package in chapter 6. I use dpkg-buildpackage usually. debuild -us -uc is good too look up too.
Then create an account on Ubuntu launchpad.
https://login.launchpad.net/+new_account
Sign the Ubuntu code of conduct:
https://launchpad.net/codeofconduct (take away the extra h, no reputation for more links)
Activate a PPA:
https://launchpad.net/people/+me/ (extra h)
Then follow this guide to upload the package to your ppa:
https://help.launchpad.net/Packaging/PPA/Uploading (extra h)
I got these links from a great answer on ask.ubuntu. It's also got a more lengthy answer on creating a deb package.
https://askubuntu.com/questions/71510/how-do-i-create-a-ppa

PHP-FPM NGinx Pthreads Linux installation

I'm trying to achieve multiple upload functionality (upload to multiple places at once).
I successfully achieved this on windows (XAMPP + PThreads DLL's) but when installing PHP-FPM+php-pecl-pthreads.x86_64, and extending the Thread class i'm getting the error:
include(Thread.php): failed to open stream: No such file or directory
i tried adding all pthreads.so related to the php.ini:
/usr/lib64/php/modules/pthreads.so
/usr/lib64/php-zts/modules/pthreads.so
/usr/lib64/libpthread.so
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/32/libmudflapth.so
/lib64/libpthread-2.12.so
but i'm getting
undefined symbol: core_globals_id in Unknown on line 0
on my phpinfo i see thread safety is disabled.
Did anyone achieve this functionality and can shed some light on how to upload to multiple places at once / installing pthreads successfully on linux.
thanks,
Danny
For debian/ubuntu
download php source (make sure you have deb-src)
apt-get source php5
go to that dir
cd php5*
go to ext dir
cd ext
download pthreads
git clone https://github.com/krakjoe/pthreads.git
rebuild the configure settings
cd .. && ./buildconf --force
ensure you have pthreads in configure options
./configure --help | grep pthre
run configure (change the paths as appropriate for your setup)
./configure --enable-debug --enable-maintainer-zts --enable-pthreads --prefix=/usr --with-config-file-path=/etc --with-apxs2=/usr/bin/apxs2 --enable-fpm
visit this for more info about user/group specific options if you need them.
make -j2
make -j2 install
Now you will have php compiled with pthreads support. Verify this:
php -m | grep pthreads
Make init script
copy sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
change user and group to the username which nginx use in /etc/init.d/php-fpm.
service nginx restart
Go to your nginx public foolder
cd <your-nginx-public-folder>
touch phpinfo.php && echo "<?php phpinfo();" >> phpinfo.php
go to your browser and search for pthreads in http://<your url>/phpinfo.php just created php file

How do I configure cygwin cyg-get mirror sites?

I installed cygwin via Chocolatey on Windows, got cyg-get package manager along with it to install packages.
Now that I want to install to packages like openssh, rsync. These are not getting downloaded since mirror site (mirror.kernel.org) is not responding and it's just paused on
downloading setup.bz2
So the question is can I select mirror sites or configure them in cyg-get just like cygwin GUI ?
Assuming that you've installed to the default location you should find the file in the following folder:
C:\ProgramData\Chocolatey\lib\cyg-get_####\tools\
You will want to modify the file cyg-get.ps1
Look for the line containing:
$cygPackages -s ftp://mirrors.kernel.org/sourceware/cygwin -P $package
and modify the URL ftp://mirrors.kernel.org/sourceware/cygwin to your preferred mirror
The newer cyg-get package, released last week, allows you to specify a source if you don't want to use the default.
Not even specifying the site worked for me, so what resolved was to open cygwinSetup executable and choose the mirror once. Then cyg-get auto selects my last mirror.

Automate installation of CentOS 6.4 -minimal with kickstart on a DVD

I am trying to automate installation of CentOS 6.4 -minimal with kickstart on a DVD
Below is my kick start that was auto generated by anaconda
# Kickstart file automatically generated by anaconda.
#version=DEVEL
install
cdrom
lang en_US.UTF-8
keyboard us
network --onboot no --device eth0 --bootproto dhcp --noipv6
rootpw --iscrypted $6$.tHtXJMs5GEzyQRm$52EX5ue3UuFC/zgencUbxuvwHXIPDuLmllkuNs4NRq7/Wa7FsI8ICxwPDsy/KnzSaUfEqfBROLAv0tPMksOhA1
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --enforcing
timezone --utc America/New_York
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
repo --name="CentOS" --baseurl=cdrom:sr0 --cost=100
%packages --nobase
#core
%end
============================================================
The problem happens when the ks.cfg tries to install packages from Repo that is in DVD
The error I'm getting:
Unable to read package metadata. This may be due to a missing repodata directory. Please ensure that your install tree has been correctly generated.
cannot find a valid baseurl for repo:CentOS
============================================================
If this a bug, is there any other way to automate the installation ?
Is there any alternate solution to Automate the CentOS6.4 minimal?
I have tried removing the line
repo --name="CentOS" --baseurl=cdrom:sr0 --cost=100
Problem still persists
Then I tried changing to something like this
repo --name="CentOS" --baseurl=file:///mnt/source--cost=100
Problem still persists
What am i missing to include .... ???
I've faced the same problem today, but after commenting the line it worked :)
#repo --name="CentOS" --baseurl=cdrom:sr1 --cost=100
Why don't you use system-config-kickstart gui tool for creating your own file and then use mkisofs to create your own iso too.
http://www.centos.org/docs/4/html/rhel-sag-en-4/ch-redhat-config-kickstart.html
The above link would be helpful.
Thanks & Regards,
Alok Thaker
From the RHEL 7 Kickstart documentation:
url Install from an installation tree on a remote server via FTP, HTTP, or HTTPS.
--url= - The location to install from. Supported protocols are HTTP, HTTPS, FTP, and file.
--mirrorlist= - The mirror URL to install from.
--proxy= - Specify an HTTP, HTTPS or FTP proxy to use while performing the installation.
--noverifyssl - Disable SSL verification when connecting to an HTTPS server.
You have to set url property, like:
url --url=http://mirror.centos.org/centos/7.0.1406/os/x86_64/
There are a handful of Packer templates that leverages kickstart scripts to create Centos VMs. One of those is the Bento Project.
You did not have a space between the second and third parameter:
repo --name="CentOS" --baseurl=file:///mnt/source/--cost=100
Correct:
repo --name="CentOS" --baseurl=file:///mnt/source/ --cost=100

Freeswitch mod_java installation problem

I am trying to install mod_java on ubuntu.
I have installed the latest java(1.6).
I have configured freeswitch with mod_java module enabled in module.conf.xml
then when i run the make file, it says:
freeswitch_java.h:5:17: error: jni.h: No such file or directory
I have searched through the java installtion folders, but did not find any include folder or jni.h.
Can anyone help, what is being the problem here.
Thanks for reading this question.
I had the same problem. The solution was to run configure with the option --with-java:
./configure --with-java=/usr/lib/jvm/java-1.6.0-openjdk/include/
I don't know if it makes any difference but I added mod_java after building freeswitch without it. It was disabled in my initial build in module.conf.xml but afterwards I ran the above command plus:
make mod_java-install
It worked for me on ubuntu with openjdk. Are you using the Sun JDK? Maybe in the version you have dont have the include folder which has the source files. Try installing the other JDK. Or try and see of ther are some other related packages in apt that will get you the include folder.
Type this linux command to locate your jni.h file on your filesystem.
locate jni.h
you should be able to get it somewhere
in /usr/lib/java directory or some other directory
depending upon your java home.
copy paste the jni.h in src/include folder of your freeswitch src.
It will throw you some more errors for different .h files
just copy all of them to your src/include folder.
in latest freeswitch, installing through Makefile, its not possible to configure as the Makefile downloads and installs. Its possible by modifying the Makefile.in file to add the include path
mod_java_la_CPPFLAGS
-I/usr/lib/jvm/default-java/include \

Resources