Cannot install php-curl on Ubuntu 16.04 & PHP 7

General Tech Bugs & Fixes 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

Command: sudo apt-get install php-curl

Output:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  php7.0-curl
The following NEW packages will be installed:
  php-curl php7.0-curl
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 28,8 kB of archives.
After this operation, 125 kB of additional https://forum.tuteehub.com/tag/disk">disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 php7.0-curl amd64 7.0.4-7ubuntu2 [26,9 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 php-curl all 1:7.0+35ubuntu6 [1.930 B]
Fetched 28,8 kB in 6s (4.630 B/s)                                              
Selecting previously unselected package php7.0-curl.
(Reading database ... 261818 files and directories currently installed.)
Preparing to unpack .../php7.0-curl_7.0.4-7ubuntu2_amd64.deb ...
Unpacking php7.0-curl (7.0.4-7ubuntu2) ...
Selecting previously unselected package php-curl.
Preparing to unpack .../php-curl_1%3a7.0+35ubuntu6_all.deb ...
Unpacking php-curl (1:7.0+35ubuntu6) ...
Processing triggers for libapache2-mod-php7.0 (7.0.4-7ubuntu2) ...
Processing triggers for php7.0-fpm (7.0.4-7ubuntu2) ...
Job for php7.0-fpm.service failed because the control process https://forum.tuteehub.com/tag/exit">exited with error code. See "systemctl status php7.0-fpm.service" and "journalctl -xe" for details.
invoke-rc.d: initscript php7.0-fpm, action "restart" failed.
dpkg: error processing package php7.0-fpm (--unpack):
 subprocess installed post-installation script returned error https://forum.tuteehub.com/tag/exit">exit status 1
Errors were encountered while processing:
 php7.0-fpm
E: Sub-process /usr/bin/dpkg returned an error code (1)

The output of sudo systemctl status php7.0-fpm.service:

● php7.0-fpm.service - The PHP 7.0 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.0-fpm.service; enabled; vendor preset: enabled)
   Active: failed (Result: https://forum.tuteehub.com/tag/exit">exit-code) since Qua 2016-05-04 11:38:06 BRT; 4min 30s ago
  Process: 491 ExecStart=/usr/sbin/php-fpm7.0 --nodaemonize --fpm-config /etc/php/7.0/fpm/php-fpm.conf (code=https://forum.tuteehub.com/tag/exit">exited, status=78)
  Process: 481 ExecStartPre=/usr/lib/php/php7.0-fpm-checkconf (code=https://forum.tuteehub.com/tag/exit">exited, status=0/SUCCESS)
 Main PID: 491 (code=https://forum.tuteehub.com/tag/exit">exited, status=78)

Mai 04 11:38:06 douglas-acer systemd[1]: Starting The PHP 7.0 FastCGI Process Manager...
Mai 04 11:38:06 douglas-acer php-fpm7.0[491]: [04-May-2016 11:38:06] ERROR: [/etc/php/7.0/fpm/php-fpm.conf:127] value is NULL for a ZEND_INI_PAR
Mai 04 11:38:06 douglas-acer php-fpm7.0[491]: PHP:  syntax error, unexpected '$' in Unknown on line 1
Mai 04 11:38:06 douglas-acer php-fpm7.0[491]: [04-May-2016 11:38:06] ERROR: failed to load configuration file '/etc/php/7.0/fpm/php-fpm.conf'
Mai 04 11:38:06 douglas-acer php-fpm7.0[491]: [04-May-2016 11:38:06] ERROR: FPM initialization failed
Mai 04 11:38:06 douglas-acer systemd[1]: php7.0-fpm.service: Main process https://forum.tuteehub.com/tag/exit">exited, code=https://forum.tuteehub.com/tag/exit">exited, status=78/n/a
Mai 04 11:38:06 douglas-acer systemd[1]: Failed to start The PHP 7.0 FastCGI Process Manager.
Mai 04 11:38:06 douglas-acer systemd[1]: php7.0-fpm.service: Unit entered failed state.
Mai 04 11:38:06 douglas-acer systemd[1]: php7.0-fpm.service: Failed with result 'https://forum.tuteehub.com/tag/exit">exit-code'.

The output of journalctl -xe

-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit php7.0-fpm.service has begun starting up.
Mai 04 11:38:06 douglas-acer php-fpm7.0[491]: [04-May-2016 11:38:06] ERROR: [/etc/php/7.0/fpm/php-fpm.conf:127] value is NULL for a ZEND_INI_PAR
Mai 04 11:38:06 douglas-acer php-fpm7.0[491]: PHP:  syntax error, unexpected '$' in Unknown on line 1
Mai 04 11:38:06 douglas-acer php-fpm7.0[491]: [04-May-2016 11:38:06] ERROR: failed to load configuration file '/etc/php/7.0/fpm/php-fpm.conf'
Mai 04 11:38:06 douglas-acer php-fpm7.0[491]: [04-May-2016 11:38:06] ERROR: FPM initialization failed
Mai 04 11:38:06 douglas-acer systemd[1]: php7.0-fpm.service: Main process https://forum.tuteehub.com/tag/exit">exited, code=https://forum.tuteehub.com/tag/exit">exited, status=78/n/a
Mai 04 11:38:06 douglas-acer systemd[1]: Failed to start The PHP 7.0 FastCGI Process Manager.
-- Subject: Unit php7.0-fpm.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit php7.0-fpm.service has failed.
-- 
-- The result is failed.
Mai 04 11:38:06 douglas-acer systemd[1]: php7.0-fpm.service: Unit entered failed state.
Mai 04 11:38:06 douglas-acer systemd[1]: php7.0-fpm.service: Failed with result 'https://forum.tuteehub.com/tag/exit">exit-code'.
Mai 04 11:38:08 douglas-acer sudo[31791]: pam_unix(sudo:session): session closed for user root
Mai 04 11:38:24 douglas-acer com.ubuntu.OneConf[1548]: WARNING:oneconf.hosts:Error in loading other_hosts file: [Errno 2] No such file or direct
Mai 04 11:39:01 douglas-acer CRON[585]: pam_unix(cron:session): session opened for user root by (uid=0)
Mai 04 11:39:01 douglas-acer CRON[587]: (root) CMD (  [ -x /usr/lib/php5/sessionclean ] && /usr/lib/php5/sessionclean)
Mai 04 11:39:01 douglas-acer CRON[585]: pam_unix(cron:session): session closed for user root
Mai 04 11:39:01 douglas-acer CRON[586]: pam_unix(cron:session): session opened for user root by (uid=0)
Mai 04 11:39:01 douglas-acer CRON[588]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && /usr/lib/php/sessionclean)
Mai 04 11:39:02 douglas-acer CRON[586]: pam_unix(cron:session): session closed for user root
Mai 04 11:40:01 douglas-acer CRON[656]: pam_unix(cron:session): session opened for user smmsp by (uid=0)
Mai 04 11:40:01 douglas-acer CRON[657]: (smmsp) CMD (test -x /etc/init.d/sendmail && test -x /usr/share/sendmail/sendmail && test -x /usr/lib/sm
Mai 04 11:40:01 douglas-acer sm-msp-queue[676]: My unqualified host name (douglas-acer) unknown; sleeping for retry
Mai 04 11:40:29 douglas-acer AptDaemon[31697]: INFO: Quitting due to inactivity
Mai 04 11:40:29 douglas-acer AptDaemon[31697]: INFO: Quitting was requested
Mai 04 11:40:29 douglas-acer org.freedesktop.PackageKit[764]: 11:40:29 AptDaemon [INFO]: Quitting due to inactivity
Mai 04 11:40:29 douglas-acer org.freedesktop.PackageKit[764]: 11:40:29 AptDaemon [INFO]: Quitting was requested
Mai 04 11:41:01 douglas-acer sm-msp-queue[676]: unable to qualify my own domain name (douglas-acer) -- using short name
Mai 04 11:41:01 douglas-acer CRON[656]: pam_unix(cron:session): session closed for user smmsp
Mai 04 11:42:36 douglas-acer sudo[707]:  douglas : TTY=pts/1 ; PWD=/home/douglas ; USER=root ; COMMAND=/bin/systemctl status php7.0-fpm.service
Mai 04 11:42:36 douglas-acer sudo[707]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mai 04 11:43:33 douglas-acer sudo[707]: pam_unix(sudo:session): session closed for user root
Mai 04 11:43:35 douglas-acer sudo[752]:  douglas : TTY=pts/1 ; PWD=/home/douglas ; USER=root ; COMMAND=/bin/systemctl status php7.0-fpm.service
Mai 04 11:43:35 douglas-acer sudo[752]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mai 04 11:43:48 douglas-acer sudo[752]: pam_unix(sudo:session): session closed for user root
profilepic.png
manpreet 2 years ago

You have an error in php-fpm.conf as stated in the logs you posted (stripped timestamps):

ERROR: [/etc/php/7.0/fpm/php-fpm.conf:127] value is NULL for a ZEND_INI_PAR
PHP:  syntax error, unexpected '$' in Unknown on line 1
ERROR: failed to load configuration file '/etc/php/7.0/fpm/php-fpm.conf'
ERROR: FPM initialization failed

Fix your php-fpm.conf and run to test the syntax:

$ sudo /usr/sbin/php-fpm7.0 --test

The output should look like this:

[04-May-2016 17:10:59] NOTICE: configuration file /etc/php/7.0/fpm/php-fpm.conf test is successful

0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community