Propel installation on local server - php

I Want to install the propel in my windows local server,I was looking at the guide but am not sure how to run their commands.any one can explain me how should i proceed with that?

Their instructions boil down to:
Go to whatever the owner project is and create a folder called vendor. Or go to some other folder if your project doesn't use that convention.
Put the source code in that folder.
TA-DA! Propel is installed. ;-)
If you'd like to use Propel's command line tools, it will take a bit more work.
If you're using WAMP you might be able to find pear by running <drive>:\wamp\bin\php\php<version>\go-pear.bat, but that isn't always consistent.
XAMPP has pear available by default at <drive>:\xampp\php\pear.bat
Once you've found pear, then either cd to the directory or call path\to\pear.bat channel-discover pear.phing.info (replace channel... with all of the other pear commands)
For your purposes this line: ln -s vendor/propel/generator/bin/propel-gen propel-gen should be "Make a Windows shortcut to vendor/propel/generator/bin/propel-gen called propel-gen and place it in your project folder"

Related

Create a basic simple web app in Zend Framework 1

I am trying to create a basic web app in zend Framework 1 and in around the web I mostly saw the tutorial for installation of ZF2 or latest.
I have followed the instruction from Zend quickstart and I have downloaded the .tar.gz and extracted to my localhost and when I run the app appending /public or /public/index.php it shows the error like below.
Please let me know if I am going in a wrong way or probably instruction to start in a correct way.
You forgot to add library into your project, Please check the Zend/ folder under library/ folder.
First make sure that you have zend framework install, if not install by typing
sudo apt-get install zend-framework
Then go to your project folder
cd /path/to/your/project
Then go to library folder of the project cd /path/to/your/project/library
Then run the command ln -s /usr/share/php/libzend-framework-php/Zend
Restart your server service apache2 restart
and thats it.

How to install PHPUnit with WAMP?

I'm a newbie programmer and I have tried for an embarrassingly long time to get PHPUnit set up and working with WAMP. I have read the documentation and went through various sites to see what I'm doing wrong, but I give up! I need someone to explain this to me in simple terms.
I've probably seen all the guides on how to set it up, but feel free to link me to something you believe is foolproof!
Try this blog : http://nishutayaltech.blogspot.com/2011/04/installing-phpunit-on-windows.html
This setup is for Windows. Hope this will help you.
Also check this out, may be useful http://www.mark-leong.com/installing-php-and-phpunit-on-windows-7/
// adding required pear channels
pear channel-update pear.php.net
pear upgrade-all
pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
pear update-channels
// performing install
pear install --alldeps --force phpunit/PHPUnit
If everything ok, check whether phpunit have been installed by putting in command line
phpunit -v
If you encountered any errors or interrupted installing
pear clear-cache
may be usefull in that case.
1) download https://phar.phpunit.de/phpunit.phar
2) run it via php phpunit.phar
Btw if that file ever goes away you can look at the original directions here: https://github.com/sebastianbergmann/phpunit
I recommend using composer. It can be used per project, but also 'globally'.
Make a folder on your C drive called 'globalpackages', then cd into it from the command line.
run 'composer require phpunit/phpunit'
once that finishes run 'composer install'
once that finishes you can check the contents of C:\globalpackages\vendor\phpunit' and should see two phpunit files, one of them a bat.
Add C:\globalpackages\vendor\phpunit to your system path and then you will be able to run phpuni from anywhere on your system.
For me this is the fastests and easiest way.
Make sure you have wamp with WAMP with PHP 7 installed as phpunit requires PHP7 to work! or at least 6.2
Go to folder
wamp64\bin\php\php7.0.10
(wherever you installed your wamp - BEWARE last folder is name of PHP version you have so it might be different then above )
We will be working in this folder during entire installation. So if I say edit file etc it means in this folder.
Download newest version of phpunit from https://phpunit.de/
At the time of writing this I get version phpunit 6.2 and php7.0.10
4. Copy downloaded file to wamp64\bin\php\php7.0.10 folder
For me it's: phpunit-6.2.2.phar
for you it might be different version.
Now change name of the phpunit-6.2.2.phar to phpunit.phar
Now make sure you have added your php to PATH in Environment Variables
To do this on Windows 10 and Windows 8
6a. In Search, search for and then select: System (Control Panel)
6b. Click the Advanced system settings link.
6c. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
6d. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Paste location of your PHP. For me it would be: D:\AnyFolderYouInsalledWampTo\wamp64\bin\php\php7.0.10
(if in PATH there was other command or path just add ";" at the end. For exmaple:
%someOtherCommand%; D:\AnyFolderYouInsalledWampTo\wamp64\bin\php\php7.0.10)
6e. Click OK. Close all remaining windows by clicking OK.
In cmd (to run cmd go to search in Windows and type cmd.exe and click Enter)
go to folder wamp64\bin\php\php7.0.10
(to go to folder type for example cd D:\AnyFolderYouInsalledWampTo\wamp64\bin\php\php7.0.10)
now once you are in this folder run this command in cmd:
echo #php "%~dp0phpunit.phar" %* > phpunit.cmd
now run this command:
phpunit
you should get list of all commands available in phpunit
now run this:
phpunit --check-version
you will get info what phpunit version you have and if you are using the newest version.
if this doesn't work go to wamp64\bin\php\php7.0.10
Edit file phpunit.bat
Add this line:
""%PHPBIN%" "D:\AnyFolderYouInsalledWampTo\wamp64\bin\php\php7.0.10\phpunit.phar" %*
Repeat point 9.
if it still doesn't work let me know.
Very well done, Emil! You're a star! Perfect answer to install PHPUnit with WAMP on Windows. Look no further than Emil.
https://stackoverflow.com/users/5753967/emil

How do I run PEAR not as root on MacOSX 10.7.4?

PEAR has to be run via sudo on my system. This is annoying for two reasons. One, every time I want to use pear I have to do a sudo. Even if it's for something as simple as wanting to see how to use 'help'. The second reason is that it installs everything as root and I can't use simple programs installed via pear (like phpdoc) without having to sudo every time (which of course makes the generated documentation owned by root.
How do I configure PEAR so that it can be usable? I understand there might be security issues with not forcing PEAR to be run as root (i.e. I shouldn't be able to install to /usr/lib/php/pear without being root), but it's insane for me to have to use sudo to use the modules installed by PEAR.
The problem was that my umask was set incorrectly to 007. This means that whenever I tried to use a package that pear had installed, I couldn't unless I was root. A better umask would be 006. This would allow everything installed to by root to be readable or executable (depending on the context).
You can set your umask in your .bashrc file in your home directory. Just add this line (or change the line that is incorrect):
umask 006
Hope this helps someone searching for an answer to this.

go-pear.bat file won't install PEAR at all

I just made a new install of WAMP on Windows 7 and I'm trying to get PEAR to work. Things are going wrong from the very beginning. When I try to execute the go-pear.bat file, it shows me this.
phar
"C:\wamp\bin\php\php5.3.1\PEAR\go-pear.phar"
does not have a signature Warning:
require_once(phar://go-pear.phar/index.php):
failed to open stream: pha r error:
invalid url or non-existent phar
"phar://go-pear.phar/index.php" in C:\
wamp\bin\php\php5.3.1\PEAR\go-pear.phar
on line 1236 Press any key to continue
. . .
How can I help it that the file doesn't have a signature?
This blog-post might interest you : Pear: “go-pear.phar” Does Not Have a Signature
It explains how to change a configuration option in php.ini to avoid this error message, and what's said it for WAMP 2.0 and PHP 5.3, so might work in your case.
Just in case anyone comes here from Google: We fixed the .phar download yesterday on http://pear.php.net/go-pear.phar.
In some circumstances (well, actually only on Windows :-)) the file could corrupt from the download. So for example, a lot of people wanted to download it and ended up copy-pasting the contents, etc..
We've asked some people on Windows to test and so far it worked for everyone I talked to. Let me know if it works for you.
Let’s try this from the PEAR directory. cd PEAR and let’s try that again.
php.exe -d phar.require_hash=0 go-pear.phar
Now the PEAR install runs fine.
If the go-pear.bat file won't run, try this procedure:
issue this command with cmd.exe:
php -d phar.require_hash=0 go-pear.phar
Allow the installer to edit php.ini.
Check the contents of PEAR_ENV.reg - located in the PEAR directory YOUR-PHP-INSTALL-PATH\PEAR\ folder (ex. c:\PHP\PEAR\PEAR_ENV.reg) to be sure it has the paths right. Edit as needed and run it. Check your path and environment variables for correctness, then do the same in go-pear.bat and php.ini (mine needed to be corrected to point correctly to my php.exe file).
Issue the
pear
command at the command line to test the path configuration. It will run and do everything but still can't install packages due to a missing dependency.
Download and uncompress Structures_Graph from the PEAR website (direct link).The file has three folders - docs, Structures and tests. Copy the Structure folder into the YOUR-PHP-INSTALL-PATH\PEAR\ folder (ex. c:\PHP\PEAR\Structures).
Issue the command:
pear install Structures_Graph
Even though the files are present, Structures_Graph is not really installed unless you issue the above command.
Issue the command:
pear update PEAR
Enjoy!
Good luck and thanks to Marcos Roriz for the graph dependency half of my solution!

Installing PEAR without access to Internet

I need to install PEAR on a server which does not have outsite access to the net. There is no go-pear.bat in the php folder and even if it had go-pear.bat i think it needs access to the net.
I looked an the Installing PEAR from a local copy from the PEAR website. But it needs PEAR to be already installed for it to work.
So do any of you guys know how to install PEAR without access to internet?
You don't need PEAR installed on the webhost, just on your local machine.
The two main approches are
Track your dependencies manually, and copy all the appropriate files to the server yourself
With pear installed on your local machine, do pear install -R/my/root_dir -a PEAR. This will install the PEAR package and all dependencies to the specified root directory. Copy this installation to your webhost.
I think it's possible to use pear to manage an installation via FTP also. I never tried.
You should also have a look at "pear help" and "pear help install".
There is a way to do this if you are on Windows and have the PHP installer.
You can select, during the PHP installation time, the PEAR option under extension menu when selecting the components for PHP installation in order to install PEAR package.
If you already have PHP installed, you just have to click on the installer to choose "modify", and choose the correct option.
http://lh4.ggpht.com/_SDci0Pf3tzU/SgBXLClDWEI/AAAAAAAAEuI/TgnBA_SEHFs/s400/pear%20install.jpg
I wrote an article on this very subject:
http://christian.roy.name/blog/install-pear-without-network-no-internet-accessoffline
It will allow you to use the pear command as well.
Create temporary folder that I will get ride of later.
mkdir pear-temp
cd pear-temp
Upload all the PEAR packages to that temp folder (using SFTP, FTP, Whatever).
If you use a USB key, then you copy them all like this:
cp /mnt/usb/*.tgz ./
Extract the core packages in a separate folder.
mkdir lib
tar x -C lib -zf PEAR-*.tgz
tar x -C lib -zf Console_Getopt-*.tgz
tar x -C lib -zf Archive_Tar-*.tgz
tar x -C lib -zf Structures_Graph-*.tgz
This bash function is to be able to set the include_path joined by colons.
function join() {
local IFS=$1
shift
echo "$*"
}
pear requires output buffering and needs to load all the core packages from the lib folder.
PHPOPT="-d output_buffering=1 -d include_path=.:$(join ':' lib/*)"
First we setup our configuration file.
php $PHPOPT lib/PEAR-*/scripts/pearcmd.php config-create $HOME/ $HOME/.pearrc
Now we install ALL our packages. Make sure you have all the required dependencies as well.
php $PHPOPT lib/PEAR-*/scripts/pearcmd.php install -o -O *.tgz
Cleanup
cd ..
rm -Rf pear-temp
Put pear in your path:
PATH="$PATH:$HOME/pear"
Edit your .profile or .bashrc if you want this to be permanent.
Edit your php.ini too or add it using set_include_path() function, whichever :)
Drink to sucess!

Categories