I'm trying to install Adminer from Ubuntu repository using:
sudo apt install adminer
Installation works fine but can't find the file /etc/adminer/apache.conf to use with Apache server. The folder /etc/adminer/ is empty and can't find it anywhere with find command.
Any help?
Thanks in advance.
In the next few steps, I'll show you how I installed adminer for Ubuntu 18.04.1 LTS .
After installation with apt package manager change into the adminer directory.
cd /usr/share/adminer
There you will find a file called compile.php.
Run the following command and the adminer-X.X.X.php (X.X.X for your version) file will be created.
sudo php compile.php
Create the apache adminer configuration file.
sudo echo "Alias /adminer.php /usr/share/adminer/adminer-X.X.X.php" | sudo tee /etc/apache2/conf-available/adminer.conf
Now you'll need to activate the configuration.
cd /etc/apache2/conf-available/
sudo a2enconf adminer.conf
Reload your apache webserver.
sudo systemctl reload apache2.
Test in your browser of choice (localhost/adminer.php)
This source was really helpful:
https://www.linuxhelp.com/how-to-install-adminer-on-ubuntu-16-04/
Install Apache:
sudo apt-get install apache2
Install PHP:
sudo apt-get install php libapache2-mod-php php-mysql
Install Adminer:
sudo wget "http://www.adminer.org/latest.php" -O /var/www/html/adminer.php
Once the installation completes, restart Apache.
sudo service apache2 restart
At this point, the setup is complete. You can access Adminer at the following address.
http://[SERVER_IP]/adminer.php
Related
I purchased a virtual server from vpscity, and chose the Ubuntu 18.4 64bit image.
it came with apache 2 installed.
i am trying to get webpagetest server installed using these instructions: https://docs.webpagetest.org/private-instances/
I did this:
sudo apt-get update &&
sudo apt-get -y dist-upgrade &&
sudo apt-get -y install zip python2.7 nginx php-fpm php-cli php-xml php-apcu php-gd php-zip php-mbstring php-curl php-sqlite3 beanstalkd imagemagick ffmpeg libjpeg-turbo-progs libimage-exiftool-perl python-setuptools python-dev build-essential python-pip python-numpy python-scipy &&
sudo pip install monotonic ujson pillow pyssim
And restarted apache.
However, when I view the website, I see raw php code.
the instructions say:
Using the PHP DSO handler mod_php can dramatically reduce the CPU required when working with large numbers of agents uploading results.
But I dont know what this means or how to implement.
If I look in /etc/apache2/mods-available
I dont see anything with php in it.
There are various people with the same problem, and several different conflicting answers such as:
AddType application/x-httpd-php .php
AddType application/x-httpd-phps .phps
AddType application/x-httpd-php3 .php3 .phtml
AddType application/x-httpd-php .html
LoadModule php7_module modules/mod_php.so
AddModule mod_php7.c
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php7.0-fpm
service apache2 reload
a2enmod php7.0
service apache2 restart
sudo apt install php libapache2-mod-php
sudo apt install php7.0-mbstring
sudo a2dismod mpm_event
sudo a2enmod mpm_prefork
service apache2 restart
gksu gedit /etc/apache2/apache2.conf
sudo apt-get install -y php5-gd php5-curl php-apc libapache2-mod-php5 ffmpeg imagemagick libjpeg-progs libimage-exiftool-perl
sudo a2enmod php5
I never thought getting apache to work with php would be this difficult.
I just noticed that the apt-get I did has nginx in it. Thats not good. Maybe there is a conflict, and I need to re-build the server and do it again without nginx? I dont see nginx running (only apache).
php -version
PHP 7.2.24-0ubuntu0.18.04.15 (cli) (built: Nov 2 2022 09:09:52) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.24-0ubuntu0.18.04.15, Copyright (c) 1999-2018, by Zend Technologies
After much trial and error, this one worked:
apt-get -y install libapache2-mod-php7.2
systemctl restart apache2
I have Install php 7.3 and apache2 but when I try to start apache2 , I have this error :
service apache2 start
apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php7.3.load: Cannot load /usr/lib/apache2/modules/libphp7.3.so into server: /usr/lib/apache2/modules/libphp7.3.so: cannot open shared object file: No such file or directory
I really don't know how to resolve this problem, I have tried to remove and reinstall without success.
You're getting that error because the PHP 7.3 library for Apache is not installed.
sudo apt install -y libapache2-mod-php7.3
The above command should fix it.
It solved my problem:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.3
sudo apt-get install php7.3-cli php7.3-common php7.3-json php7.3-opcache php7.3-mysql php7.3-mbstring php7.3-zip php7.3-fpm php7.3-intl php7.3-simplexml
sudo service apache2 restart
For me the problem was that I did not install apache tools for php.
On arch linux:
yaourt -S php-apache
After that, module appeared in the folder.
The best way not to make a mistake is to follow guide: https://wiki.archlinux.org/title/Apache_HTTP_Server#PHP
I am using the Netbeans IDE, PHP version 7.0 and I have already installed Apache version 2.4.18 and Linux Mint 18.
I have also tried to install the debug files with
sudo apt-get install php7.0-xdebug
How can I proceed further?
Download last stable release of xdebug 2.6.0 :
wget -c "http://xdebug.org/files/xdebug-2.6.0.tgz"
Extract file :
tar -xf xdebug-2.6.0.tgz
cd xdebug-2.6.0/
Build extension
phpize
./configure
make && make install
after finshed compiling i found the binary on path;
/usr/lib/php/20151012/xdebug.so
for find xdebug.so use this comand :
pwd -L xdebug
it print out : /etc/php/7.0/mods-available
then go in directory /etc/php/7.0/mods-available and edit file as superuser nano xdebug.ini file add follows lines:
zend_extension=/usr/lib/php/20151012/xdebug.so
xdebug.show_error_trace = 1
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.profiler_enable=1
sudo systemctl restart apache2.service or sudo /etc/init.d/apache2 restart
http://wiki.netbeans.org/HowToConfigureXDebug
I am trying to connect with a MSSQL database using laravel homestead. It always throws the exception:
PDOException in Connector.php line 55: could not find driver.
I've seen a lot of people talking about FreeTDS and Sybase drivers, but I can't seem to figure out what I need to enable laravel/php access to MSSQL databases from a Linux Web Server running the Laravel Homestead Vagrant box.
I did lots of R&D for resolving this issue. Finally found the solution:
Laravel vagrant is using php 7. For mssql support we have to enable the relevant sybase driver for linux :
To Enable MSSQL Support for PHP 7:
First, ssh into your box vagrant ssh from the Homestead folder.
Command : vagrant ssh
Install the Sybase package for enabling the support for PDO and Mssql.
Command : sudo apt-get install php7.0-sybase
then run php -m on the ssh to make sure pdo_dblib is enabled.
All Done!!!! Cheers
The following works for php72. You may try changing the version of php in the commands.
vagrant ssh
#set the default PHP version to 7.2
php72
sudo su
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
#Download appropriate package for the OS version
#Choose only ONE of the following, corresponding to your OS version
#Ubuntu 16.04
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
#Ubuntu 18.04
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
#Ubuntu 20.04
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql17
sudo ACCEPT_EULA=Y apt-get install mssql-tools
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
sudo apt-get install unixodbc-dev
sudo pecl config-set php_ini /etc/php/7.2/fpm/php.ini
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
sudo su
printf "; priority=20\nextension=sqlsrv.so\n" > /etc/php/7.2/mods-available/sqlsrv.ini
printf "; priority=30\nextension=pdo_sqlsrv.so\n" > /etc/php/7.2/mods-available/pdo_sqlsrv.ini
exit
sudo phpenmod -v 7.2 sqlsrv pdo_sqlsrv
sudo systemctl restart php7.2-fpm
# restart nginx, if needed:
sudo systemctl restart nginx.service
References:
https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#ubuntu17
https://learn.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-ver15#installing-the-drivers-on-ubuntu-1604-1804-and-2004
Laravel uses PDO extension to connect to database, you could check if the extension is enabled using
var_dump(class_exists('PDO'))
Also, if you could post the specific error, it would be great.
Thanks for this. Still works as of now with:
php7.2-sybase
using DB_HOST= IP_ADDRESS\NAMED_INSTANCE
Commenting out the PORT directive in both .env and database.php
By mistake I have applied the command,
sudo rm -rf /etc/init.d/apache2 restart
after that i can't run apache2
How can I solve this?
Do as below:
sudo apt-get purge apache2
sudo apt-get install apache2
sudo service apache2 start
If Apache2 is installed as part of a system package (e.g. with Debian apt-get), then you should be able to get it back by removing and reinstalling the package (I hesitate to say use e.g. the reinstall option because I don't think that touches config files). You could also fetch the source package and find the init.d file in that and copy it back.