How was my running php compiled? - compilation

I'm trying to compile a new instance of PHP (5.4.0) from the source code and want to keep compatibility with the one (PHP 5.3.6-13ubuntu3.6) already installed from the distro, Ubuntu-11.10. That is, I want to run ./configure with the same directives as the installed PHP.
I always could see the ./configure command outputted by phpinfo() but this time, for my surprise, it's not provided.
Do you know of any flag that prevent phpinfo of outputting the compile configuration? Or,
Do you know of any other way to get how PHP was compiled?

Original answer
There should be a script php-config you can install on ubuntu to get the configure parameters used for php.
sudo apt-get install php5-dev
php-config --configure-options
2023 Update
The php-config executable is currently present in the generic package phpX.Y-dev, where X and Y is the major and minor version of the php package installed on your system. Also, the name of the executable reflects your php version.
sudo apt-get install php8.1-dev
php-config8.1 --configure-options
A list of popular ubuntu version and corresponding package:
Ubuntu 18.04: php7.2-dev
Ubuntu 20.04: php7.4-dev
Ubuntu 21.04: php7.4-dev
Ubuntu 21.10: php8.0-dev
Ubuntu 22.04: php8.1-dev
Ubuntu 22.10: php8.1-dev
Ubuntu 23.04*¹: php8.1-dev
*¹ Lunar Lobster nightly, scheduled to be released as 23.04

According to this bug report, the Configure Command output was intentionally suppressed from Ubuntu & Debian PHP builds.
Then recommend installing the source package via apt-get source php5:
If you want to see how PHP is built in Ubuntu, apt-get source php5,
and peruse debian/rules, the ./configure output in phpinfo() is, as the
changelog for the patch states, entirely misleading and not terribly
informative.

Related

How to download PPA through proxy on Debian WSL?

I am trying to download/install php7.2 on Debian which is installed on my WSL (Windows Subsystem for Linux), through my company's proxy.
I have been able to download apt packages by using this solution : https://askubuntu.com/questions/89437/how-to-install-packages-with-apt-get-on-a-system-connected-via-proxy
The problem now is that I need ppa from sudo add-apt-repository ppa:ondrej/php cause php > 7.0 is not available anymore with sudo apt-get install and I tried many solutions but no one worked for me. Every solution tested by the asker of https://unix.stackexchange.com/questions/361213/unable-to-add-gpg-key-with-apt-key-behind-a-proxy were tried and the answers too.
So, there is my last obstacle :
$ sudo -E add-apt-repository ppa:ondrej/php
Co-installable PHP versions: PHP 5.6, PHP 7.x and most requested extensions are included. Only
Supported Versions of PHP (http://php.net/supported-versions.php) for Supported Ubuntu Releases
(https://wiki.ubuntu.com/Releases) are provided. Don't ask for end-of-life PHP versions or Ubuntu
release, they won't be provided.
Debian oldstable and stable packages are provided as well: https://deb.sury.org/#debian-dpa
You can get more information about the packages at https://deb.sury.org
BUGS&FEATURES: This PPA now has a issue tracker:
https://deb.sury.org/#bug-reporting
CAVEATS:
1. If you are using php-gearman, you need to add ppa:ondrej/pkg-gearman
2. If you are using apache2, you are advised to add ppa:ondrej/apache2
3. If you are using nginx, you are advise to add ppa:ondrej/nginx-mainline
or ppa:ondrej/nginx
PLEASE READ: If you like my work and want to give me a little motivation, please consider donating
regularly: https://donate.sury.org/
WARNING: add-apt-repository is broken with non-UTF-8 locales, see
https://github.com/oerdnj/deb.sury.org/issues/56 for workaround:
# LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
More info: https://launchpad.net/~ondrej/+archive/ubuntu/php
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keybox '/tmp/tmpw9sj_dvp/pubring.gpg' created
gpg: keyserver receive failed: No name

apt in Linux Subsystem for Windows 10 is failing with 404 Not Found

OK, so this is my first SO question so I'm gonna try my best to lay this out.
I have a Windows 10 laptop on which I am trying to install gcc. I have in the past tried alternatives such as netbeans, cygwin and various emulators and virtual machines all to no avail.
What has been working so far is that I enabled the 'new' windows developer mode which allowed me to download a Linux bash shell from the windows store. It works for all the regular Linux commands, but doesn't have gcc installed.
When I type in gcc (or gcc --version) in the shell, it prints the following line:
The program 'gcc' is currently not installed. You can install it by typing:
sudo apt install gcc
Which I tried, it then ran through a bunch of installer stuff but consistently seemed to run into errors such as the following:
Err:7 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libdpkg- >perl all 1.18.4ubuntu1.2
404 Not Found [IP: INSERT IP ADDRESS HERE ]
where the ip address is different on each error line.
It ultimately fails with the following line:
Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
I have tried but again I get the same kinds of errors as above.
I would really like to get gcc working in the Windows/Linux shell as it is working great for everything else, and I'm trying to keep the number of programs on my computer to a minimum.
Does anyone know why this isn't working, or how (if possible) I can make it work?
P.S I do need it to be gcc because of school reasons
For what it's worth: I landed on this SO topic after having a similar issue.
What fixed it for me was to run
sudo apt-get update
sudo apt-get upgrade
I guess the repo URLs were too old, even though my Ubuntu was in a recent version.
I just ran into the same thing attempting to install python-pip. According to this article, this happens when you have the Windows 10 Anniversary Update (older) instead of the Creators update (newer). The solution is to either uninstall and re-install Ubuntu, or upgrade it (from 14.04 to 16.04). I found the upgrade to be simple and painless:
sudo do-release-upgrade
To check what you have, before and after via:
lsb_release -a
I had the same problem. Pinging the IP resulted in no response and visiting the website returned a 404.
I found a ppa with most current GCC and registered the PPA and was able to successfully install GCC with it; ppa website. I used GCC to build some software I wanted that was not found with apt-get.
From their page:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
Try to run Ubuntu application in Windows with an option "Run as Administrator".

Install make 3.75 on ubuntu 15.10

I am new to ubuntu. I am looking for any help in installing GNU Make version 3.75 or other older version on ubuntu 15.10. I understand that the package for older version doesnot exist for ubuntu 15.10 and I am not able to get the instruction anywhere on how to get the packages.
Any help regarding this is appreciated.TIA
sudo apt-get build-dep make
wget http://ftp.gnu.org/gnu/make/make-3.75.tar.gz
tar xvf make-3.75.tar.gz
cd make-3.75
./configure
make
sudo make install prefix=/opt/make-3.75
# or sudo make install to install it into /usr/local
Why do you need this? As arved suggests: if your Makefiles are 20 years old and incompatible with current versions of make, and can't be fixed, you probably have bigger problems elsewhere. Whatever those Makefiles try to do may require some tweaking to work on Ubuntu 15.10.

Installing older version of GCC from source

I have gcc4.6 installed. I need 4.2 to be installed without disturbing current version.
OS - Ubuntu 12.04 LTS
Either install using --prefix configure switch to choose another path to install to, or --program-suffix switch, e.g. --program--suffix=-4.2. The docs have more information.
Please note that by default, the prefix will be /usr/local/, but the Ubuntu package will install to just /usr/, so things should be fine. However, if your $PATH lists /usr/local/bin before /usr/bin, you might still run into problems.

ns-2 - ./validate fails in Ubuntu 13.10

I was able to make ns-2 (ns-allinone-2.35) install on Ubuntu 13.10 successfully by modifying linkstate/ls.h, but one test case in the validation suite always seems to fail - tcpLinux. This bothers me because validation works properly in Ubuntu 12. Would you know how to fix this or if this is an issue at all?
Thanks in advance!
So it looks like ns-2 doesn't play nice with the newer versions of gcc.
Before installing, do
export CC=gcc-4.4 CXX=g++-4.4
If you don't have these older versions, use
sudo apt-get install gcc-4.4 g++-4.4
Using this method, I didn't have to modify any source code before building.

Resources