Ubuntu搭建LAMP环境(安装libpng)出现问题,没有makefile文件

继续安装php开发环境,当安装到libpng的时候,输入make命令,确发现提示错误,没有找到makefile。

我还纳闷儿了,明明有makefile.am 和 makefile.in啊,configure以后不就生成makefile了嘛,于是又执行了一遍configure,结果在最后一行发现错误,如下。

configure: error: zlib not installed

google以后,发现大家都是用的这个方法解决:

1.进入zlib的源文件目录,执行命令 make clean,清除zlib;
2.重新配置 ./configure,后面不要接–prefix参数;
3.编辑 make && make install 安装;
4.进入libpng目录,执行命令 ./configure –prefix=/usr/local/libpng;
5.编译 make && make install 安装;

————————————-华丽丽的分割线,下面是英语版———————–

English Version:

Continue to install the PHP environment.
When install the libpng package after entering the make command, the error “cannot find the makefile” might occur.
I’m so confused~~,  the makefile.am and makefile.in obviously exsit in the directory. The makefile should be generated after configuring.
So I perform the configure command again, and then find this error:

configure: error: zlib not installed

Google it, find following solution that many people are using:
1. Enter the directory where the zlib source file is, and perform the make clean command to clean up zlib.
2. Reconfigure using  ./configure without  –prefix parameter.
3. Perform make and make isntall
4. Enter the libpng directory, execute the command ./configure –prefix=/usr/local/libpng.
5. Perform command make and make install.

Leave a Reply

Your email address will not be published.