Apache start libphp7.3.so not found - 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

Related

php7.4 in ubuntu 21.10: apache2 fails to start

I try to run php7.4 in ubuntu 21.10 but I get this error.
apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php7.4.load: Cannot load /usr/lib/apache2/modules/libphp7.4.so into server: /usr/lib/apache2/modules/libphp7.4.so: cannot open shared object file: No such file or directory
Missing libphp7.4.so
I installed libphp7.4-embed but the problem persists. The files are installed in /usr/lib/ not in /usr/lib/apache2/modules/. Symbolic link did not help (undefined symbol: php7_module).
How to make php7.4 run in ubuntu 21.10?
I try some commands
$ sudo a2enconf php7.4-fpm
Conf php7.4-fpm already enabled
$ sudo a2enmod php7.4-fpm
ERROR: Module php7.4-fpm does not exist!
Both OP and #Andrew have pieced together a good solution, but since I just had to do this, let me put it all together, with a few extra clarification steps.
First: What version of PHP do you have now / will you use?
php -v
Returns PHP 8.1.2 so 8.1 in my case.
Next, disable the existing apache2 module that was giving you trouble:
sudo a2dismod php7.4
Finally, enable the one you found above:
sudo a2enmod php8.1
Restart apache2 and you're all set.
sudo systemctl restart apache2
after much try and error:
rm /etc/apache2/mods-enabled/php7.4.load
Now it works.
(there is only one php* in mods-enabled: php7.4.conf. I don't know if it matters.)

Oracle JDK 11 error occuring every time, I install anything in terminal

Below is the Error message I get every time I install anything in the terminal . Its kinda stuck there for a while.
I tried no. of solutions from StackOverflow but nothing worked.
Before installing this package,
please download the Oracle JDK 11 .tar.gz file
with the same version as this package (version 11.0.4),
and place it in /var/cache/oracle-jdk11-installer-local,
E.g.:
sudo mkdir -p /var/cache/oracle-jdk11-installer-local
sudo cp jdk-11.0.4_linux-x64_bin.tar.gz /var/cache/oracle-jdk11-installer-local/
sha256sum mismatch jdk-11.0.4_linux-x64_bin.tar.gz
Oracle JDK 11 is NOT installed.
dpkg: error processing package oracle-java11-installer-local (--configure):
installed oracle-java11-installer-local package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
oracle-java11-installer-local
E: Sub-process /usr/bin/dpkg returned an error code (1)
Doesn't show up again.
Remove the package oracle-java11-installer-local. You can do this in following way:
sudo apt remove oracle-java11-installer-local
found this solution:
sudo rm /var/lib/dpkg/info/oracle-java11-installer-local.postinst
at this site.
You need to download the folder of the Oracle JDK 11 on here https://www.oracle.com/java/technologies/javase-jdk11-downloads.html
After download the tar.gz file. Move to your folder location then copy the file by using this command
sudo cp jdk-11.0.6_linux-x64_bin.tar.gz /var/cache/oracle-jdk11-installer-local/
don't forget to check your file name! After that repeat again by typing
sudo apt-get install oracle-java11-installer-local
and you can check your java version after that by typing
java -version
Hello,
I've had the same issue.
When you try to run sudo apt update && sudo apt upgrade it will automatically try to update the Java if a newer version is available. In my case let's say from 11.0.4 -> 11.0.5.
If you add the JDK from Oracle (after download) to /var/cache/oracle-jdk11-installer-local/ it should work.
You don't have to uninstall it...(I mean the oracle-jdk11-installer-local, it works just fine).
Please let me know if you still have this issue.
I had the same issue. My solution was to download jdk-11.0.5_linux-x64_bin.tar.gz and copied it to /var/cache/oracle-jdk11-installer-local.
In console shell, type:
sudo apt update && sudo apt upgrade
After a long search: this solved it for me.
The checksum made the issues for me. Try:
sudo rm /var/lib/dpkg/info/oracle-java11-installer-local.postinst -f
Navigating to the directory var/cache and doing "sudo rmdir oracle-jdk11-installer-local/" worked for me.
sudo rmdir oracle-jdk11-installer-local/
I have managed to resolve the issue by doing this:
modify /var/lib/dpkg/info/oracle-java11-installer-local.postinst
Change the checkSum. take from oracle website check sum for 11.0.15.1
3. change the version in 2 places
4. save and update apt
5. then sudo apt install oracle-java11-installer-local
this worked for me

Install Adminer on Ubuntu 18.04 bionic

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

Install rst2man failed for varnish agent [fix]

I'm trying install varnish agent on ubuntu server using virtual box. There is a message in the middle installation process that say "you need rst2man installed to make dist".
When I tried install rst2man using "sudo apt-get install rst2man" another message come in :
Reading package list....done
Building dependecy tree
Reading state information....done
E: unable to locate package rst2man
"unable to locate package rst2man" what does it mean ? anyone know ? please help.
Problem fix:
I tried to install python-docutils for the rst2man.
rst2man is a virtual package, then you need install python-docutils package than provide rst2man and utilities for the documentation of Python modules.
sudo apt-get install python-docutils
After install this package, try the command:
sudo which rst2man
python-docutils wasn't working for me
I had to install the package docutils-common
sudo apt-get install docutils-common
In case if you installing varnish-agent-2 - after
sudo apt-get install python-docutils
you should execute again
./configure
Working on CentOS and likely RHEL as well:
yum install python-docutils

How can we reset apache2

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.

Resources