Building php5.3 with ./configure not creating a Makefile - php

I'm using ubuntu 14.04, attempting to build and install php 5.3.22. I am unable to build as when I enter 'make' I get:
make: *** No targets specified and no makefile found. Stop.
Doing some research, it means that there is no Makefile, which should have been created when I ran ./configure. I got no error or feedback when running ./configure, nor do I get anything when I run ./configure --help. I'm in the correct build directory, otherwise I would get 'command not found?'
Other solutions suggest running autogen.sh, but I think that's only when you are building from a repo.
I also read that there should be a Makefile.in file somewhere, but I do not see that in the directory.
I just want to be able to properly configure and get a generated Makefile so I can build.

To generate the configure script, try running ./buildconf --force. I've not done this myself but got this by looking at the source repo and a couple of Google searches.
Before you can build PHP you first need to obtain its source code. There are two ways to do this: You can either download an archive from PHP’s download page or clone the git repository from git.php.net (or the mirror on Github).
The build process is slightly different for both cases: The git repository doesn’t bundle a configure script, so you’ll need to generate it using the buildconf script, which makes use of autoconf. Furthermore the git repository does not contain a pregenerated parser, so you’ll also need to have bison installed.
PHP Internals Book

Related

PhpDocumentor for Laravel 5.7/6.x

This might be a very newbie question but, how exactly do you use phpDocumentor to generate your docs through Laravel? In my Laravel project there's no phpdoc in the vendor/bin directory, and trying to install phpDocumentor via composer fails (as suggested on the GitHub page).
I couldn't find any recent resources about it, the only thing I had luck with is running the phpDocumentor.phar file from the terminal, but the newest version fails immediately.
To get this working, downgrade to PHP 7.1. Then download the latest phpDocumentor.phar file from [http://www.phpdoc.org/phpDocumentor.phar]. Place the phpDocumentor.phar into your Laravel 6.x project's /vendor/bin/ directory.
Then use Homebrew to install other needed packages...
brew install intltool
brew install graphviz
Lastly, cd into /vendor/bin and run...
php phpDocumentor.phar -d ../../app/Http/Controllers
Your documentation output should be at /vendor/bin/output.
Adding a more complete solution that worked for me on creating documentation of my Laravel project with the system environment comprising of MacOS Catalina,Laravel 6 and PHP 7.2.
Visit https://docs.phpdoc.org/3.0/guide/getting-started/installing.html. To install the dependencies, recommended to update homebrew as brew update and brew upgrade. After updating the homebrew, execute the following:
brew install graphviz
brew install plantuml
Once the dependencies are installed, download the phpDocumentor.phar from the above link, and make the file executable as follows:
chmod +x phpDocumentor.phar
Then, copy and paste this file to your laravel app under /vendor/bin
I also placed this file under local bin mv phpDocumentor.phar /usr/local/bin/phpDocumentor for easier access (as shown in step 6 below).
For testing purpose, create a simple test.php file under /vendor/bin/docs/test.php directory with the following content as mentioned in https://docs.phpdoc.org/3.0/guide/getting-started/your-first-set-of-documentation.html
<?php
/**
* This is a DocBlock.
*/
function associatedFunction()
{
}
Then execute the phpdoc script from the same /vendor/bin location as:
phpDocumentor.phar -d docs/test.php -t docs/test
This will generate several files.
Open the index.html file generated in your web browser (eg. Chrome) to view the documentation:
open -a "Google Chrome" ./docs/test/index.html
Notably, because we placed the phpDocumentor.phar in /usr/local/bin/phpDocumentor/phpDocumentor.phar, we can easily access phpdoc and easily create the documentation of our whole App as follows ( the documentation will be stored inside the folder DOCS)
phpDocumentor.phar -d app/ -t DOCS/
I have found the problem with most PHP documentation solutions is they require large amounts of code just to get something you can actually use. And that takes a lot of time and trial and error to set up.
I also have issues with the generated documentation. Often it is not even sorted! Also it is hard to navigate and understand the whole class. As a consumer of a class, you are not interested in private or even protected things (unless you are trying to extend it). But often the docs only show you the methods and properties of the current class, and not what it inherits (which is the WHOLE point of OO!).
Anyway, I got sick of the current state of PHP documentation and decided to do it right. I wrote PHPFUI/InstaDoc to address all the issues I had with existing solutions. InstaDoc is the fastest document generator out there because it simply scans the class directory structure and saves it off. This generally only takes a few seconds (for large code bases) each time you generate (on release, or if you add a new class in your dev env). Then it renders the docs for a specific class at runtime, because, hey, who ever looks at the documentation anyway? Just us nerds, and there are not many of us, and we can wait a fraction of a second for the server to generate the docs on the fly. Also you don't need server disk space to store all your docs. They are generated on the fly. And of course if you have a high volume site, InstaDoc can generate static HTML files, but who has a high volume PHP doc site (like nobody).
Anyway, check out a live example at PHPFUI/InstaDoc and see if it fits your needs. It is not a Laravel module or plug in, but you should be able to run it under Laravel easily. Just return the output of the controller in your controller, and it should just work.

Point local version of a PEAR Package to a development path?

I'm trying to fix a bug in a more complex PEAR package (CodeCoverage). So I'd like to have the development version that exists not within my PEAR path:
c:\Programme\PHP\PEAR\PHP
with one on another location, here exemplary:
c:\Dokumente und Einstellungen\hakre\PhpstormProjects\php-code-coverage\PHP\
Is there a common way in PEAR to temporarily switch from the installed package to just the files on another location of the disk?
I tried with placing a symbolic link, but that does not work because I need to link CodeCoverage.php as well which is not possible on Windows XP.
Is there some kind of development switch for this kind of scenario in PEAR or is it just that it's the business of each package to take care of that?
I'm using the CodeCoverage package together with PHPUnit.
I could get it to work by adding it to PHP's include path before the PEAR dir:
include_path = ".;c:\path\to\php-code-coverage;C:\programme\php\pear"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Invoking PHPUnit now uses the standard package but the development version of CodeCoverage. No symbolic linking required, editing php.ini is enough.
The "Contributing" section of the PHPUnit github project has a runner script included to make that task easier for you.
You can ether check out all the repositories from there or, if you only need one, still use the runner script:
#!/bin/bash
php -d include_path='.:../phpunit/:../dbunit/:../php-code-coverage/:../php-file-iterator/:../php-invoker/:../php-text-template/:../php-timer:../php-token-stream:../phpunit-mock-objects/:../phpunit-selenium/:../phpunit-story/:/usr/local/lib/php' ../phpunit/phpunit.php $*
(intentially not formatted as code so the whole thing is shown)
You can adapt the pathes to an absolute one by replacing .. with /path/to/your/dev/folder/ and put the script in /usr/local/bin/ and call it phpunit-dev.
Then it will automatically pick up all the existing folders and fall back to the pear path at the end for everything it can't find.
Another way to get a dev setup quickly would be to install it from composer with minimum-stability: dev and change the remote on one of the repos :)

using PEAR with MAC OS X

I've tried using pear to install both phpunit and phpdoc and seem to be running into a problem with my pear installation.
following the installation guide here :
You can prepare your PEAR installation using the following commands: $ pear channel-discover pear.phpdoc.org
this gives me an error message:
-bash: pear: command not found
I've seen mention of using $ locate bin/pear to find the installation. This gives me the following message:
WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.
Not sure what that means, but if I'm reading it correctly, it's saying that pear isn't there. I know my path to pear is /Applications/MAMP/bin/php/php5.3.6/bin/pear /Applications/MAMP/bin/php/php5.3.6/bin/pear.
I'm a little lost on what to try next. Any suggestions on what I'm doing wrong?
Create your locate database using the command given. You can think of this in terms of the way spotlight has to "load" or index everything when you first install osx. 'can take some time' usually means 'will take some time'
If you know your pear path you can execute it directly:
/Applications/MAMP/bin/php/php5.3.6/bin/pear channel-discover pear.phpdoc.org
or add an alias to it manually in your bash profile directory
http://blog.elucidcode.com/2011/03/terminal-aliases-in-os-x/
or make a link to it in /usr/bin.
For an overview. It seems pear is installed fine. Just when you type in 'pear' into the console osx doesn't recognize that as being a command, Its like a shortcut on your desktop that doesn't point to anywhere. What needs to be done (using one of the methods above) is to point the "desktop shortcut" (the pear command) to the actually pear binary.
Try using the full path to pear:
$ /Applications/MAMP/bin/php/php5.3.6/bin/pear channel-discover pear.phpdoc.org
When you enter a unix command like that, the first part is the application that you want to run. Typing "pear" means you want to run the pear app. Your OS knows a few directories in which to look for applications. You can see what they are by entering the command:
echo $PATH
The list is separated by colons. If the application you want to run is not in one of those folders, then your OS doesn't know where to find it. It won't automatically search your entire hard drive to find an application of that name. That would be a security risk, or at the least slow and ambiguous if you have more than one app with the same name.
If you enter the entire path to your application, like I've suggested above, then your OS knows exactly where to find the application and will run it directly without searching through the directories in your PATH.
You can add new directories to your PATH and you can add an alias to an application to one of the PATH directories. Then you would be able to just type "pear" and the OS could find it. There are tutorials for adding directories to your PATH all over the internet.
The locate database needs to be created in order to use the locate command. This is a separate issue. You can build the locate database and it will look over all of your files. It will take a little while to run, but when it's done the locate command will work. However, since you already know where your pear app is, locate won't give you any new information.

Understanding symfony2 deps

I'm working with symfony2 for some time and I don't really get the correct way to work with the vendors.
So here is what I'm doing:
I have the deps and deps.lock files in my git while I ignore the whole vendors folder. Now when I install the application to a new server, I do a php bin/vendors install to pull the vendors onto the server. I get the message that I have to use install --reinstall and do that.
From my understanding, the versions should now be the exact same as on my development machine, as both deps and deps.lock are the same. But it seems that the deps.lock gets (partly) ignored?
There is also a vendors update command, which I read should not be used. BUt I didn't get the idea what it really does.
So I'm a bit confused now as of what command should be used when and what it is supposed to do. Maybe someone can shed some light on this topic! I'm especially interested in the correct way to use the vendors command both local and on the server so the vendors are in the correct version on both systems!
install and update both fetch new code from the git repositories specified in your deps file
install checks for hashes in you deps.lock files for each library. If it finds something, it checkouts the commit corresponding to the hash. If it does not, it checkouts the tag or branch in your deps.lock if one is specified and creates an entry in the deps.lock file
update is useful when you want to update to a new version of symfony (or any library in the deps file). If you one day, you feel like updating, you can read this post I wrote about the update process.
To sum up, I always use update on all machines, and I try to always specify a version for each library, so that the production environment does not get updated to an unstable version unexpectedly.
install --reinstall is the same as install but it also deletes vendor folder content before doing installation.
vendors update updates all your vendors to the latest version or version specified in your deps file and updates your deps.lock file. But you rarely need it, don't know where you read "should not be used".
If you look inside vendors file, you can see this line:
if (is_dir($vendorDir.'/symfony') && !is_dir($vendorDir.'/symfony/.git') && !in_array('--reinstall', $argv))
...Try to run ./bin/vendors install --reinstall...
So you have vendor/symfony folder without .git in it.
have you download the standard edition which already contains the vendors, that's why it displays this message to use "install - reinstall"
I personally made ​​php bin / install-reinstall vendors in the deployement project

Install completion file via PEAR

I have a PHP command-line tool that I'm trying to distribute via a pear channel.
Installing the binary itself is no problem.
What I'm looking for is a way to install it's associated bash completion file, which should go in /etc/bash_completion.d/.
No, it's not possible to install files to arbitrary locations with PEAR.
You could write a post-install script which copies an installed file into /etc/bash_completion.d/, though.
I found that you can define custom file roles, which would seem to be the right way to go about this:
http://pear.php.net/manual/en/guide.migrating.customroles.defining.php

Categories