How to install wordpress with MariaDB? - mysql

I am trying to install wordpress on my nginx + mariadb
First step of: pointing my url to
http://localhost/wordpress/
is throwing following error:
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
I hope many other people are using wordpress with mariadb.
[EDIT]
Using WNMP for bundle installation of ( Nginx + MariaDB + PHP )

Maybe this helps you, its for Windows 7. Here are the steps
Get the files
Download only the compressed files which do not require installation to use the programs
get the Xeoncross’ WNMP https://github.com/Xeoncross/wnmp
get memcached http://code.jellycan.com/memcached/
get MySQL http://dev.mysql.com/downloads/
get nginx http://nginx.org/en/download.html
get PHP http://windows.php.net/download/
get phpMyAdmin http://www.phpmyadmin.net/home_page/downloads.php
get wordpress http://www.wordpress.org/
Place the files
extract the content of WNMP to d:wemp
extract the memcached.exe to d:wempmemcached
extract the contents of MySQL to d:wempMySQL
extract the contents of nginx to d:wempnginx
extract the content of PHP to d:wempPHP
extract the content of phpMyAmdin to d:wempwwwphpMyAdmin
extract the content of wordpress to d:wempwwwwordpress
Configure
for MySQL, rename d:wempMySQLmy-small.ini to my.ini
for NginX, copy d:wempexample.nginx.conf to d:wempnginxconf, rename nginx.conf to nginx.conf.bak and rename example.nginx.conf to nginx.conf
for PHP, rename d:wempPHPphp.ini - development to php.ini
open the php.ini file in a text editor, remove the ; preceeding extension_dir = "ext"
remove the ; preceeding cgi.fix_pathinfo = 1
remove the ; preceeding extension=php_mbstring.dll
remove the ; preceeding extension=php_mysql.dll, save the file
Run
run d:wempstart_server.bat to start running, a few command prompt windows will pop up and disappear
Confirm they are running
open task manager by pressing Ctrl + Shift + Esc
check php-cgi.exe, memcached.exe, mysqld.exe, nginx.exe are running
run the following command in command prompt to change the root password of MySQL d:wempmysqlbinmysqladmin -u root password hereIsYourPassword
If face problem starting mysqld.exe than look the error in d:wempmysqldataerr.log
Test the server and install WordPress
start a browser (make sure there is no proxy)
visit http://localhost/
see the WNMP success page
visit http://localhost/phpMyAdmin/
log in with username root, password hereIsYourPassword!
create a database with the name wordpress
visit http://localhost/wordpress/
start the famous 5 mins installation of wordpress

mariadb is 100% compatible with the mysql interface in php
i think you're missing the module for php
depending on the distribution you're using i'd say do a
sudo apt-get install php5-mysqlnd
you can make sure the mysql mod is enabled by doing a phpinfo();
when running php5-fpm with nginx make sure the module is enabled at the right place
/etc/php5/fpm/

Related

how to setup phpmyadmin on nginx with laraval?

does anybody know how to setup phpmyadmin on nginx server (ubuntu) with laravel?..
my site is built with laravel and hosted on /var/www/mysite/
the default nginx-config is disabled...site is not hosted under the default html directory, but on the /var/www/mysite directory...(because i plan to host one more site on the same server in future)
Laraval installation works, but i am unable to access phpmyadmin..
i have already tried the ln -s /usr/share/phpmyadmin /var/www/mysite/ approach but laravel gives a 404 error
the guides found on the internet do not specify how to install phpmyadmin onto a nginx-laravel combo.. the settings are different than a normal nginx only installation..
does anybody know the correct steps to make it working?
Your question is not about use specifically phpmyadmin, but how to use more than one site under the same host with nginx, it doesn't matter if it is phpmyadmin. If you already have your website at /var/www/mysite you cannot map the phpmyadmin to the same path (symlink), you have to map it to another folder, like this:
ln -s /usr/share/phpmyadmin /var/www/phpmyadmin/
Make sure that your .conf files at nginx are right, post them here.
Remember to reload the server and it could be the case to map the public phpmyadmin folder (that contains index file) if it exists.
Check it out: https://fedingo.com/how-to-host-multiple-domains-on-one-server-in-nginx/
English isn't my first language, ask me again if you didn't understand something.

How to create opt/bitnami/apps/myapp/conf/httpd-prefix.conf and include /opt/bitnami/apps/myapp/conf/httpd-app.conf

Please guys help out, am using google compute engine for the first time and using bitnami. I have successfully spin up a server, and connected with ssh but am stock here https://docs.bitnami.com/virtual-machine/components/nodejs/#how-to-create-a-custom-nodejs-application
Can anyone help me explain how:
1.- Create and edit the /opt/bitnami/apps/myapp/conf/httpd-prefix.conf file and add the line below to it:
Include "/opt/bitnami/apps/myapp/conf/httpd-app.conf"
2.- Create and edit the /opt/bitnami/apps/myapp/conf/httpd-app.conf file and add the content below to it. This is the main configuration file for your application, so modify it further depending on your application's requirements.
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
NOTE: 3000 is the default port for the Express server. If you have
customized your application to use a different port, change it here as
well.
3.- Once you have created the files and directories above, add the following line to the end of the main Apache configuration file at /opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf, as shown below:
Include "/opt/bitnami/apps/myapp/conf/httpd-prefix.conf"
According to the Bitnami guide shared by you, you should follow the following steps (I added more detailed information):
1.- Create directories
For that, you should run the following commands:
sudo mkdir -p /opt/bitnami/apps/myapp
sudo mkdir /opt/bitnami/apps/myapp/conf
sudo mkdir /opt/bitnami/apps/myapp/htdocs
2.- Create two files
For that, you can run the following commands:
touch /opt/bitnami/apps/myapp/conf/httpd-prefix.conf
touch /opt/bitnami/apps/myapp/conf/httpd-app.conf
3.- Add content to the first file
You can edit the file using any text editor, for example nano
nano /opt/bitnami/apps/myapp/conf/httpd-prefix.conf
The above command opens the text editor, you should copy/paste or write the following line:
Include "/opt/bitnami/apps/myapp/conf/httpd-app.conf"
Close the editor using Ctrl+X(you will be prompted to save your file if you have not)
4.- Add content to the second file
You can edit the file using any text editor, for example nano
nano /opt/bitnami/apps/myapp/conf/httpd-app.conf
The above command opens the text editor, you should copy/paste or write the following line:
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
Close the editor using Ctrl+X(you will be prompted to save your file if you have not)
5.- Edit Apache config file
Once you have created the files and directories above, add the following line to the end of the main Apache configuration file. Open the file (again using nano):
nano /opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf
The above command opens the text editor, you should copy/paste or write the following line:
Include "/opt/bitnami/apps/myapp/conf/httpd-prefix.conf"
Close the editor using Ctrl+X(you will be prompted to save your file if you have not)
6.- Restart apache
For that execute
sudo /opt/bitnami/ctlscript.sh restart apache
7.- Start the Express server
cd /opt/bitnami/apps/myapp/htdocs
./bin/www
Alternatively, use the following command to start the server and keep it running even after your server session ends. Replace FILE with the correct filename for your application.
forever start FILE.js

PHP Mysql laravel 5.4 terminal issue

i am new to laravel i just figured out how to install composer laravel etc etc on my local machine MAMP on windows , Now i am confuse with the command on terminal which is
C:\project>mysql -uroot -proot
'mysql' is not recognized as an internal or external command,
operable program or batch file.
How can i fix this ?
setting Environment will solve the issue
Go to Control Panel -> System -> Advanced
Click - Environment Variables
Go to- System Variables find PATH and click on it.
add the path to your mysql\bin folder to the end paths. (ex: E:\xampp\mysql\bin) and add ; end of the line
Close all the command prompts you opens.
Re open and try it.
Setting the PATH to point to the MYSQL bin folder is normally the first thought, but I find that dangerous as things get left lying around when you change software.
I normally create a little batch file in the projects folder or in a folder that it already on your PATH, like this
mysqlpath.cmd
echo off
PATH=C:\mamp\path\to\the\mysql\bin;%PATH%
mysql -v
The mysql -v will output the mysql version number but it is a handy way of knowing that the correct folder has been added to the PATH. This adds the folder to the PATH but only for the life of the command window.
Then just run this from any command window when you want to use MYSQL from the command line
> phppath
You may also like to create one for PHP as well
phppath.cmd
echo off
PATH=C:\mamp\path\to\the\php\;%PATH%
php -v

How to connect to Mysql from Lua with local-infile=1

I am connecting to a mysql database from lua using :
mysql = require "luasql.mysql"
local env = mysql.mysql()
local conn = env:connect(database,userName,password)
but the option local-infile is not activated so my requests using LOAD DATA don't work.
I tried to put the line
local-infile = 1
in the file my.cnf in the field [client] but it still doesn't work.
FYI : I am using linux and mysql 5.1.
I went through the same situation last week. The query LOAD DATA INFILE worked on Mac OSX, but I could not make it work on Ubuntu. The only way I found to make it work was adding one line of code to the LuaSQL project and recompiling it.
I used the MySQL driver's function mysql_options (you can check its prototype in the mysql.h file, probably located at /usr/include/mysql) to enable the local-infile. You can check the code at the repository.
To compile and install this workaround, you should download the files:
$ wget https://github.com/rafaeldias/luasql/archive/master.zip
$ unzip master.zip
To compile and install :
$ cd luasql-master/
$ make
$ sudo make install
Note: Depending on where your Lua and MySQL folders are located, you may need to set the proper values for the LUA_LIBDIR, LUA_DIR , LUA_INC , DRIVER_LIBS and DRIVER_INCS in the config file within the LuaSQL folder.
Hope it helps.

Cannot login to phpMyAdmin, no errors shown

I have MySQL set up correctly on my linux computer, however I want a better way to input data into the database besides terminal. For this reason, I downloaded phpMyAdmin. However, when I try to log in to the phpMyAdmin from index.php, it doesnt do anything. It seems to just refresh the page without doing anything. I am putting in the correct MySQL username and password. What is the issue?
Here is a screen shot of what it shows after I click "go".
This is a possible issue when the path to save php_session is not correctly set :
The directory for storing session does not exists or php do not have sufficient rights to write to it.
To define the php_session directory simply add the following line to the php.ini :
session.save_path="/tmp/php_session/"
And give write rights to the http server.
usually, the http server run as user daemon in group daemon. If it is the case, the following commands will make it :
chown -R :daemon /tmp/php_session
chmod -R g+wr /tmp/php_session
service httpd restart
Login fails if session folder in not writeable. To check that, create a PHP file in your web directory with:
<?php
$sessionPath = 'undefined';
if (!($sessionPath = ini_get('session.save_path'))) {
$sessionPath = isset($_ENV['TMP']) ? $_ENV['TMP'] : sys_get_temp_dir();
}
if (!is_writeable($sessionPath)) {
echo 'Session directory "'. $sessionPath . '"" is not writeable';
} else {
echo 'Session directory: "' . $sessionPath . '" is writeable';
}
If session folder is not writeable do either
sudo setfacl -R -m u:www-data:rwx <session directory> or chmod 777 sudo setfacl -R -m u:www-data:rwx <session directory>
-
I am late to the game, but on Amazon linux AMI I could not log in to phpmyadmin ... it just kept refreshing the login screen with no errors.
I have fixed with below command
sudo chmod -R 755 /var/lib/php/session
I fixed my issue on CentOS 7 with MariaDB and phpmyadmin I downloaded from offical phpmyadmin site by adding
session.save_path = "/var/lib/php/session"
to /etc/php.ini
and
chown -R :lighttpd /var/lib/php/session
I also restarted php-fpm and lighttpd after
In my case the solution was to set an Apache setting properly:
ProxyPassReverseCookiePath
This was required, because ProxyPass and ProxyPassReverse were in use, but cookie paths are not changed automatically.
It'd be great if PHPMyAdmin had shown something like session not found or anything, when password is sent with POST.
Do you have a .htaccess file in one of the parent directories that strips off index.php from the url by doing a 301 redirect?
301 redirects discard the form data and redirect you as if you didn't submit anything. So you get returned to the login page.
So you should create a local .htaccess file in the phpmyadmin directory with a single line RewriteEngine On. This will overwrite the previous rewrite rule to nothing.
You may need to clear the browser cache as Chrome aggressively caches 301 redirects.
In my case the hard drive was full.
Use df -h to check the space left on your hard drive, and if you want you can free some space by using the command sudo apt-get clean, which removes installation files.
I hope this will help some future users.
I ran these commands and it worked for me:
sudo service httpd restart
sudo service mysqld stop
sudo service mysqld start
Try searching the web for installation or setup guides for phpMyAdmin. Look at two or three of these and make sure you have covered all the required steps. (If you have already done so, please include which guides you have followed it in the question).
See if it helps to edit config.inc.php (acecoder mentioned this as well).
Check if this guide is of any help.
Which distro are you on? Try searching for the name of the distro you are using together with "phpMyAdmin guide" or "phpMyAdmin setup howto".
If you encounter errors along the way, post the error text here, if it's short (or paste via a pastebin-like site if it's long).
Are you sure that mysql is running? I had the same issue after doing a database import and filling up the volume containing the mysql database. After changing various permissions and clearing sessions, I tried to restart mysql (/etc/init.d/mysql restart) and it failed because the volume was full. After increasing /var and starting mysql successfully, I was able to log into phpmyadmin just fine.
If you have an error like:
Host 'host_name' is blocked because of many connection errors.
Login in your mysql as root and run the flush hosts command
1.- mysql -u root -p
2.- mysql > flush hosts
After this I was able to login again in phpmyadmin
phpMyAdmin will show errors when login fails. If it doesn't, it means that your setup has an error.
The most likely place to check is your php.ini settings. Since there doesn't seem to be an official list of phpMyAdmin-compatible settings, it's mostly trial and error.
Make sure you have enabled the stuff that needs to be enabled. Also check that you did not enable uncommon php.ini settings (like enable_post_data_reading = Off) because phpMyAdmin assumes them to be "the usual ones".
To ease debugging, start with a clean default php.ini file then tweak them line by line to see which setting is causing the error. (Don't forget that you need to restart your server after changing the php.ini file for the changes to take place.)
In my case it was due to an old Apache session.
Stop Apache, clear all pending sessions in your sessions.save_path directory (example: /var/lib/php/session) and restart Apache.
Make sure to set a 32 chars long random key in 'config.inc.php' in the $cfg['blowfish_secret'] value. That solved it for me.
Didn't realize I need to restart MariaDB after modifying config.inc.php:
service mariadb restart
Otherwise at least in my case changes didn't come affect. Also make sure your php session directory is writable by webserver (typically session.save_path = "/var/lib/php/session")