about mysql installation in a LAMP environment - mysql

When I build a LAMP environment in ubuntu-12.10,
first I installed mysql by mysql-5.5.12.tar.gz,but it told me that it can not find configure
file,it was here:
root#tryandchange-QTH6:/usr/local/src# cd mysql-5.5.12
root#tryandchange-QTH6:/usr/local/src/mysql-5.5.12# ./configure --prefix=/usr/local/mysql
bash: ./configure: 没有那个文件或目录(not exists the document or the file)
who can tell me why?Or tell me that a good way to build a LAMP environment,
but not 'apt-get install'.

XAMPP has downloadable Linux binaries, you just download, extract and run /path/to/xampp/xampp start - I'd recommend those as the easiest way to set up a LAMPP stack.
Link to XAMPP for Linux
Obviously by eschewing the use of apt, you are working with the knowledge that your apache/php/mysql will become obsolete and you will have to work to keep them secured and up-to-date.

Related

How to install Mysql-server in Ubuntu offline

I need to install Mysql-server in an Ubuntu 18 machine which do not have any internet access. There are plethora of instruction material exist on this this subject but all they require Ubuntu machine to be online.
One such documentation can be available here (quite comprehensive though)
https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-18-04
Any help on offline installation of Mysql-server will be highly helpful.
I suggest you follow this guide on how to use apt-offline. https://linoxide.com/debian/install-debian-packages-offline/
As a general guide:
You start by having apt-offline installed on both PCs, this is done by default on the desktop releases, but can easily be installed by just downloading the .deb package for your release from the packages.ubuntu.com website: https://packages.ubuntu.com/bionic/all/apt-offline/download
Then create a signature that can be put onto another PC that'll do the downloading/fetching updates and make a note that we also need mysql-server
apt-offline set offline-servers-state.sig --install-packages mysql-server
You can then use this signature on a PC connected to the internet using the same tool to check for updates and/or download the required files into a zip file
apt-offline get --bundle zip/file/location/bundle.zip offline-servers-state.sig
Once downloaded you can put this .zip back on the offline server to install the packages
apt-offline install zip/file/location/bundle.zip
You can visit https://dev.mysql.com/downloads/mysql/ from a computer that can go online.
Then, select your OS and version
Download DEB Bundle on a computer that can go online. Move the downloaded file internally to your system that cannot hit the Internet.
Your downloaded file will be a .tar. Use command tar -xvf filename.tar (See https://www.cyberciti.biz/faq/tar-extract-linux/ for command).
You will get a new directory. cd that-directory will get you in that directory. You will see a bunch of .deb files.
Install the deb files one by one using sudo apt-get install filename.deb depending on what you want to install. Other commands to install deb files can be found in this discussion https://unix.stackexchange.com/questions/159094/how-to-install-a-deb-file-by-dpkg-i-or-by-apt.

Configuring apache 2.4 with php 5.6.32 configuring with source in linux

I have installed httpd 2.4, downloaded .tar.gz and configured as:
./configure --with-apr=/tmp/apr-1.6.3 --with-apr-util=/tmp/apr-util-1.6.1 --enable-so && make && make install (my apr and apr-util are at /tmp location)
also I have installed php 5.6.32, downloaded tar.gz and configured as:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --enable-fpm && make && make install
Problem is I am unable to add the fpm handler, any direction what should I do.
Should I proceed with how its described in redhat developer guide or apache wiki for FPM
Thanks in advance and correcting me, if I am doing some/lots of thinh wrong :)
Why trying to build from sources when binary packages exists in various repositories ?
Yes the PHP Configuration Tips gives you correct way to use FPM (as the Apache wiki in the SetHandler way).
The linked howto is for CentOS 7, but works for CentOS 6 using the httpd24 Software Collections.
Alternative solution is to use a 3rd party repository, such as "remi", see the Wizard instructions.

How do I enable the intl extension in CakePHP?

I am using CakePHP 3 and MAMP Pro server for my project. When I am trying to bake the cake, this error shows up:
Fatal error: You must enable the intl extension to use CakePHP.
I have even included intl.so and extension=php_intl.dll in my php.ini file but couldn't figure out solution for this error.
this issue was happening to me some days ago. I had installed Ubuntu 18.04 and php 7.1.
I was trying to run the comman php cake.php bake in orden to use cakephp's console but I was getting the following error message:
You must enable the intl extension to use CakePHP.
This extension (intl) was installed for php 7.1 (php7.1-intl) but this message was appearing every time I used php cake.php bake
After some google searches, I saw that I have to install the extension but with the following command:
sudo apt-get install php-intl
The same issue happened with mbstring extension, I used the command:
sudo apt-get install php-mbstring
then I restarted the apache server with:
sudo service apache2 restart
It's difficult to pinpoint exactly what's wrong without seeing your system setup. However based on what was said in the question, you may be setting up the intl extension incorrectly.
First off, if your OS is Linux/macOS and the PHP extension is a shared library (i.e. has a .so extension) then the php.ini entry should be extension=intl.so not extension=php_intl.dll. Also make sure the intl.so file is in the directory configured under the ini entry extension_dir. Otherwise make sure the extension ini entry is fully qualified (e.g. extension=/path/to/extension/dir/intl.so).
If you are using a Linux OS that has a package manager such as Debian/Ubuntu, you may be able to more easily install the extension for the PHP packaged for that distro. For example, in Ubuntu/Debian the package php5-intl provides the intl extension for PHP5 (I assume it's something similar for PHP7 if you've enabled those repos).
If you build PHP from source, you can try bundling the extension into your PHP. See the instructions from the manual.
I faced the same issue.
I added extension="php_intl.dll" in php.ini and restarted the Apache server.
Now it is working.
I had the same issue. After starting from scratch, I did :
$ brew install php
$ composer install && composer update && composer dump-autoload --optimize
$ composer self-update && composer create-project --prefer-dist cakephp/app:^3.8 cms
$ cd cms
$ bin/cake server
And it was working !

Best way to install MySQL 5.6 on Centos 6.4

I just installed Centos 6.4, and installed MySQL using the version that came with the Centos distribution. To my dismay, it is MySQL 5.1.69 versus the current 5.6.12. As stated on http://dev.mysql.com/doc/refman/5.5/en/linux-installation-native.html, "the MySQL version will often be some way behind the currently available release", but I didn't expect that long.
[root#centosBox ~]# rpm -qa | grep mysql
mysql-5.1.69-1.el6_4.x86_64
mysql-devel-5.1.69-1.el6_4.x86_64
mysql-server-5.1.69-1.el6_4.x86_64
mysql-libs-5.1.69-1.el6_4.x86_64
[root#centosBox ~]# whereis mysql
mysql: /usr/bin/mysql /usr/lib64/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
[root#centosBox ~]#
An alternative is to install by RPM packages which is the "recommended way to install MySQL" per http://dev.mysql.com/doc/refman/5.5/en/linux-installation-rpm.html. I have done so and it wasn't overly complicated, however, I am concerned as I've often been told that I should always install by yum when available. Towards the very end of the documentation, it does describe doing so extremely briefly using yum, however, it is so brief that I question whether it is the way to go.
So.... What is the best way for a not guru Linux user to install/upgrade MySQL on a Centos machine?
Just this week (2013-10-28), MySQL announced official yum repositories for MySQL Community Edition. The packages are intended for use with RHEL-compatible Linux (e.g. CentOS).
All the details including how to set up the yum repo on your system, can be found from the announcement:
http://insidemysql.com/announcing-new-yum-repositories-for-mysql/
A bit off-topic but there we go.
It is recommended to install from the repositories because you can later update your software to a newer version with a simple yum upgrade. The repository takes care of that for you, as well as any dependencies the software may entertain with other libraries.
RPM Packages installed manually (even with yum, which then only acts as an installer) will have to be managed manually as well.
Since the MySQL RPM package shows no dependencies (as far as I can tell from the manual), you are safe from this side.
And to answer your question: the best method is to stick with the versions from the repository. If you need a newer version, then you took the right path.
I am no guru myself but I was happy with the result of the RPM method you mentioned since other times I have seen problems with mysql-libs being a dependency for other packages.
(depending on the 5.6 version you want and cpu)
mkdir MySQL
cd MySQL
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-5.6.16-1.el6.x86_64.rpm-bundle.tar
tar -xvf MySQL-5.6.16-1.el6.x86_64.rpm-bundle.tar
yum install MySQL*rpm
installs them in the correct order and removes mysql-libs in one step without conflicts.
http://dev.mysql.com/doc/refman/5.6/en/linux-installation-rpm.html
It doesn't surprise me that MySQL is a bit behind. Why would Oracle make it easy for you to not use pay-for Oracle? </rant>
Anyway, you can get the awkwardly named, but otherwise identical MariaDB to run easily by adding a new YUM repository.
You can install MySQL 5.5 (mysql55-server.x86_64) from IUS repository (currently version 5.5.34 available)

set up MySQL with MAMP for Ruby

I'm trying to use Ruby with the MySQL that comes with MAMP, but there is a problem with the headers not being installed (or something like that).
Someone referred me to the tutorial copied below but I can't get it to work. When I put in the first line ./configure... it says no such directory.
1) One question in particular is, it says, "copy the MySQL source file (mysql-5.1.37.tar.gz) to somewhere on your hard drive." I don't know if by installing MAMP I have already done this step or not. If not, then I don't know what to do.
2) I also don't know what it means when it says "untar" the source file and "cd"...If MAMP is installed, has it been untarred already?
3) Also, do would I just open the terminal and start this code, or do I have to go into Mysql?
I wonder if anyone can tell me how to adapt it. Here are 2 other pieces of information about my installation that might be helpful.
a). MySQL is set up on port 8889 on my computer.
b) Also when I enter "which mysql" in the command line, it responds with "/usr/local/mysql/bin/mysql."
Please help if you can. Thanks.
Download the latest MAMP dmg file.
Download the 1.8.2 (or whichever the latest one you could find) components file from this page.
Unzip, mount the dmg, then copy the MySQL source file (mysql-5.1.37.tar.gz) to somewhere on your hard drive.
Untar the MySQL source file, and `cd` to the source file directory.
Compile the library:
$ ./configure --with-unix-socket-path=/Applications/MAMP/tmp/mysql/mysql.sock --without-server --prefix=/Applications/MAMP/Library
$ make -j2
Copy the compiled libraries into MAMP:
$ cp libmysql/.libs/*.dylib /Applications/MAMP/Library/lib/mysql
Copy the MYSQL headers into MAMP:
$ mkdir /Applications/MAMP/Library/include
$ cp -R include /Applications/MAMP/Library/include/mysql
Install the Ruby MySQL Gem, on Snow Leopard:
$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
On Leopard:
$ sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
Enjoy!
EDIT # 2009-11-23: If you’re still experiencing problems (perhaps with RVM), try adding “/Applications/MAMP/Library/bin/” to your $PATH in “~/.bash_profile”.
You should probably follow the tutorial in this link. It is updated for MAMP 1.9.5 with mysql2. A couple of changes have been made to the new MAMP version.
http://blog.mirotin.net/?p=35
Furthermore the tar file you need can be found at this link. Download the MAMP_components_1.9.5.dmg file.
http://sourceforge.net/projects/mamp/files/mamp/1.9.5/
Finally got through this with this blog post: http://newfangled.me/installing-mamp-and-rails-on-a-mac/
Here's the archived version of that incase it goes offline http://web.archive.org/web/20130728130916/http://newfangled.me/installing-mamp-and-rails-on-a-mac
The other answer's reference 404s for me. http://blog.mirotin.net/?p=35
I'd been struggling with this for a while myself.