I can't compile PHP :(

Hello Geekos!!

It’s my first post here, but i’m using openSUSE since 2007. I’m trying to compile PHP 5.4.15 from source on openSUSE 12.3 but the process fails.

The dependences that I installed:

zypper install apache2-devel autoconf bison curl-devel db-devel enchant-devel freetype2-devel gcc-c++ gmp-devel imap-devel krb5-devel libbz2-devel libevent-devel libicu-devel libmcrypt-devel libpng-devel libtidy-devel libtiff-devel libtool libxslt-devel ncurses-devel net-snmp-devel openldap2-devel pam-devel pkgconfig postfix postgresql-devel tcpd-devel unixODBC-devel update-alternatives xorg-x11-devel freetds-devel mysql-devel aspell-devel libgcrypt-devel libjpeg rpm-devel libedit-devel libjpeg-devel pcre-devel re2c sqlite-devel sqlite2-devel t1lib-devel smtp_daemon tcpd-devel

The script to compile:

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/apache/conf --libdir=/usr/lib64 --with-apxs2=/usr/local/apache/bin/apxs --enable-sigchild --with-gd --with-mariadb --with-libdir=/lib64 --enable-ftp --with-zlib --with-bz2 --enable-zip --with-pear --with-layout=GN --enable-ctype --with-iconv --with-gettext --enable-xml --with-xmlrpc --enable-gd-native-ttf --with-imap-ssl --enable-soap --with-freetype-dir=/usr/include/freetype2/ --enable-bcmath --enable-mbstring --enable-sockets --with-gd --with-png-dir --with-openssl --with-oci8=instantclient,/usr/lib/oracle/11.2/client64/lib --with-pgsql=/usr/local/postgres --with-mcrypt --enable-shmop --enable-sysvsem

The process ends with:

“checking size of char… configure: error: cannot compute sizeof (char)”

Thanks !!!

Forgive my poor english.

At the very least you should probably post this in the
programming/scripting forum. It may also be advisable to take this up
with the PHP folks directly with a bit more data about where in the
compilation process things fail. I’d start with the #php chnanel on IRC
(irc.freenoe.net). Answers may be available somewhere on this forum, but
to me this is probably something the PHP folks will have seen more often.

Good luck.

Hello Deicidium,

Welcome here.

We hope you will fid you at home here. There is one thing I want to “teach” you and that is the usage of CODE tags. That is not easy to find, that is why we have to explain to every “newcomer” here.

Whenever you want to post computer text here in a post (and we like that, because what the computer “says” is often more telling then what people say), please copy/paste that between CODE tags. You get those tags by clicking on the # button in the toolbar of the post editor.

And please when you post output of a command, then make the copy sweep a bit wider: it should include the prompt, the command, the output and the next prompt.

Hi, welcome to the forums !!

The usual question first: why compile this yourself? If the reason is other than “because I want to”, don’t. openSUSE has it’s Buildservice where thousands of packages are built and being published in repositories. In your case PHP 5.4.15 is available from the official Devel/Languages/PHP repo. If you don’t make manual changes in compiling PHP, doing so would in the best case lead to an identical install compared to the one from the repos.
Start Yast - Software repositories - Add - Repositories maintained by the community, check the PHP repo, trust the key when prompted for.
Next start the Softwaremanager, go View - Repositories, tick the PHP repo, and click the “link” on the top right that says “Switch system packages to …”
Restart apache2 or reboot and you’re running PHP 5.4.15

Some addition: as you can see PHP would be installed in /usr/local, is expecting apache in /usr/local . On openSUSE these two aren’t in /usr/local, but in /usr/lib64 or /usr/lib , depending on 64bit/32bit install.

Thanks for the advices, but I compile evetything from source, except mariadb, because it’s a requeriment from my Work. It’s a weird thing becuase I can compile this on Debian, Fedora, Red Hat Linux Enterprise, Oracle Linux and CentOS.

Well, you are missing basic packages for compiling software.
Install “gcc” and “make” for starters.

Or the easier way: Start YaST->Software Management and install one of the development patterns. (f.e. C/C++ Development)
See openSUSE 12.3: Chapter 5. Installing or Removing Software for that.

I installed the Patterns for basic development, python, C/C++, Mono, Qt Development previously. :frowning:

Well, have you ever tried to compile anything before?

Maybe you should start with something smaller than PHP first. Maybe try to compile a helloworld program first to check that your compiler works.

And regarding your original error message: (“checking size of char… configure: error: cannot compute sizeof (char)”)
you can see the reason for the failure in the file config.log.

I compiled Apache HTTP Server 2.4.4 sucessfully.

And PHP still doesn’t build?

As I said, the reason can be found in the file “config.log”.
Maybe upload that to susepaste.org and post the link here.

I’m going to install everything tomorrow, Gracias fellas.