To get no warning in running PHP in Ubuntu's terminal

I run

php test_code.php

I get

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/gd.so' - /usr/lib/php5/20060613+lfs/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/mcrypt.so' - /usr/lib/php5/20060613+lfs/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
-- I get the right output after these strange Warnings --

The files do not exist in the warnings.

How can you get no warnings in running PHP in Ubuntu's terminal?

Upvotes: 0

Views: 3519

Answers (5)

Mpumelelo Msimanga
Mpumelelo Msimanga

Reputation: 21

A reply this to this bug post on Launchpad https://bugs.launchpad.net/ubuntu/+source/php5/+bug/281979 solved the problem for me.

In short remove the .ini files. In my case the following commands worked:

/etc/php5/conf.d# rm mcrypt.ini
/etc/php5/conf.d# rm suhosin.ini

Upvotes: 2

inakiabt
inakiabt

Reputation: 1963

PHP-GD and PHP-MCrypt are installed correctly?

<?php
phpinfo();
?>

are there?

If not:

# apt-get install php5-gd php5-mcrypt

Upvotes: 1

David
David

Reputation: 802

A quick search at Ubuntu Packages shows these are in the php5-gd and php5-mcrypt.


sudo apt-get install php5-gd php5-mcrypt

Upvotes: 3

Alistair Evans
Alistair Evans

Reputation: 36503

Set the error_reporting ini value to 0, which means no error notices:

php -d error_reporting=0 test_code.php 

Although, you should probably try and fix those errors.

Upvotes: 1

Andrejs Cainikovs
Andrejs Cainikovs

Reputation: 28464

Either:

A) Install missing libraries
OR
B) Remove gd and mcrypt modules from your php.ini
OR
C) Remove error reporting, which is really bad idea.

Upvotes: 2

Related Questions