Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

Friday, May 4, 2018

Install PHPMyAdmin after installing Mysql on Ubuntu 16.04

 sudo apt-get update
    sudo apt-get install phpmyadmin php-mbstring php-gettext

After opening PHPMyAdmin if you create a database and open it you may see

CONNECTION FOR CONTROLUSER AS DEFINED IN YOUR CONFIGURATION FAILED

You have to open this file

/etc/phpmyadmin/config-db.php

and see if the configuration is like this

$dbuser='root';
$dbpass='password'; // set current password between quotes ' '
$basepath='';
$dbname='phpmyadmin';
$dbserver='';
$dbport='';
$dbtype='mysql';

save and close the file

restart mysql server by

sudo service mysql stop

sudo service mysql start


Tuesday, February 17, 2015

php mcrypt not found solved and install and enable curl

sudo apt-get install php5-mcrypt
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
sudo php5enmod mcrypt 
sudo service apache2 restart

install and enable curl extension

sudo apt-get install curl libcurl3 libcurl3-dev php5-curl

Wednesday, December 24, 2014

Apache,PHP and SSL configuration on Slackware 12.2

apache,php and ssl configuration on slackware

login as root

pkgtool

select setup

click services

select rc.httpd

put a star beside it

exit

mcedit /etc/httpd/httpd.conf

find the line

DirectoryIndex index.html

copy the line and paste it just below the line

DirectoryIndex index.html

change html to php

find mod_php

you will find the line

Include /etc/httpd/mod_php.conf

uncomment this line

save and exit

mcedit /etc/httpd/php.ini

find the line

short_open_tag=Off

change it to On

find another line

asp_tags=Off

change it to On

save and exit

cd /var/www/htdocs

mc

the mc interface will open

copy the index.html file
rename the copied file as index.php

open the index.php file in mc

write

less than?php

phpinfo();
?greater than

save and exit

/etc/rc.d/rc.httpd stop

/etc/rc.d/rc.httpd start

go to http://192.168.28.51/index.php

you should see the php information

to get the information about httpd

slackpkg info httpd

cd /etc/rc.d

ls

you will find rc.httpd

if rc.httpd is not executable

make it executable

chmod +x rc.httpd

mcedit /etc/httpd/httpd.conf

find the line 

Listen 80

change it to

192.168.28.51:80

find the line

starting with 

Loadmodule ssl

uncomment this line

find the file

Include /etc/httpd/extra/httpd-ssl.conf

uncomment this line

save and exit

open

/etc/httpd/extra/httpd-ssl.conf

find the line 

Listen 443

change it to

192.168.28.51:443

(if you keep the Listen 443 line ,you will get an error starting apache,so remove Listen 443)

find

SSLCertificateFile "/etc/httpd/server.crt"

uncomment the line if it is commented

find

SSLCertificateKeyFile "/etc/httpd/server.key"

uncomment the line if it is commented

save and exit

Now 

locate *.crt

you will find a crt file in the /usr/doc/openvpn 2.x/sample-keys folder

go to that folder

copy server.crt and server.key file to /etc/httpd/


/etc/rc.d/rc.httpd restart

netstat -ntlp | grep httpd

it will show httpd listening on 80 and 443 port

open

https://192.168.28.51