Install laravel ends up in wrong directory (composer with cygwin) - command-line

I am trying to install laravel with the use of cygwin, a command line tool for windows.
I use this line
composer create-project laravel/laravel=4.2.0 c/my_workspace/projectname --prefer-dist
which installs everything. But it does not end up in c:/my_workspace/projectname. Instead it ends up in cygwin64/c/my_workspace/projectname.
The next time I tried it it ended up in a different folder, also inside "cygwin64".
It doesn't matter what path I specify, the path will start in the cygwin64 folder for some reason. By the way, in cygwin there is a always a prefix for the paths called /cygdrive/. Is that what causes it to start from cygwin64?
I also tried instead to execute it from cmd by navigating to
cd c:/myworkspace
And then entering
composer create-project laravel/laravel=4.2.0 /projectname --prefer-dist
It says "Installling", and then "loading from cache" (?), then it says
failed to download laravel/laravel from dist: C:my_workspace/vendor/composer/5079c43b does not exist and could not be created
Then it tries to download from source. When cloning starts it fails:
Failed to clone git#github.com:laravel/laravel.git, git was not found

I managed to get it installed finally. I suppose there was something wrong with the way I wrote the filepath:
c/my_workspace/projectname
so it was created in the cygwin64 folder (for some reason). This time I navigated to the folder where I want the install:
cd c:/my_workspace/projectname
then install with:
composer create-project laravel/laravel=4.2.0 --prefer-dist
However, I got a mkdir() permission denied problem, which was solved by running cygwin as administrator.
Then I got another problem where you setup the laravel development server with
$ php artisan serve
It could not find the artisan file because it was located inside a "laravel" folder(!?), which I guess wasn't right, so I moved the laravel files back to my project folder and deleted the laravel folder. The laravel development server has started so I guess it works now.

Related

make virtualenvwrapper to work with different python versions

fix: sorry, all is fine, error was because of no module installed in this new environment, jinja2.
First time using virtualenvwrapper so I am little confused.
Setup went fine, I read the docs, but still I don't understand few things.
In my .bashrc file I've set:
# virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Snakepit
source /usr/bin/virtualenvwrapper.sh
I already have my project files, so I thougt I should do the following:
Go into ~/Snakepit/ directory, run mkvirtualenv -p /usr/bin/python2 [ envname ]
(I need this specific version for my project), and I saw it created in
~/.virtualenvs/ dir.
My command promt changes showing me that my new environment is [ envname ].
When I do now: python -V, it shows that I am using version 2.7 of python, so
all is well!
But when I move now, my project files into Snakepit directory, and try
running my program with python myprogram.py it shows me errors because it
still tries to run my program with python 3.
How is that possible when python -V shows version 2.7?
Error was not about python version being run, but instead module missing in newly created environment. I will leave it, for a feature reference.

How to migrate virtualenv

I have a relatively big project that has many dependencies, and I would like to distribute this project around, but installing these dependencies where a bit of a pain, and takes a very long time (pip install takes quite some time). So I was wondering if it was possible to migrate a whole virtualenv to another machine and have it running.
I tried copying the whole virtualenv, but whenever I try running something, this virtualenv still uses the path of my old machine. For instance when I run
source activate
pserve development.ini
I get
bash: ../bin/pserve: /home/sshum/backend/bin/python: bad interpreter: No such file or directory
This is my old directory. So is there a way to have virtualenv reconfigure this path with a new path?
I tried sed -i 's/sshum/dev1/g' * in the bin directory and it solved that issue. However, I'm getting a different issue now, my guess is that this sed changed something.
I've confirmed that I have libssl-dev installed but when I run python I get:
E: Unable to locate package libssl.so.1.0.0
E: Couldn't find any package by regex 'libssl.so.1.0.0'
But when I run aptitude search libssl and I see:
i A libssl-dev - SSL development libraries, header files and documentation
I also tried virtualenv --relocatable backend but no go.
Export virtualenvironment
from within the virtual environment:
pip freeze > requirements.txt
as example, here is for myproject virtual environment:
once in the new machine & environment, copy the requirements.txt into the new project folder in the new machine and run the terminal command:
sudo pip install -r requirements.txt
then you should have all the packages previously available in the old virtual environment.
When you create a new virtualenv it is configured for the computer it is running on. I even think that it is configured for that specific directory it is created in. So I think you should always create a fresh virtualenv when you move you code. What might work is copying the lib/Pythonx.x/site-packages in your virtualenv directory, but I don't think that is a particularly good solution.
What may be a better solution is using the pip download cache. This will at least speed up the download part of pip install. Have a look at this thread: How do I install from a local cache with pip?
The clean way seems to be with virtualenv --relocatable.
Alternatively, you can do it manually by editing the VIRTUAL_ENV path in bin/activate to reflect the changes. If you choose to do so, you must also edit the first line (#) of bin/pserve which indicates the interpreter path.

Install with pecl to local dir on shared hosting

I'd like to install a PHP extension on a bluehost shared site; specifically the MongoDB driver. Since pecl is unable to write to the primary server directory that has all the installed extensions, I'd like to install the mongo.so file to a directory I specify under my home. The closest article I found on the web was:
http://www.site5.com/blog/programming/php/how-to-setup-your-own-php-pear-environment/20090624/
However, after following the steps when I use the "pecl install mongo" command, it still keeps trying to install to bluehost's central directory on the server.
According to my web host's technical support team, utilising the pecl installer attempts to install the extension server-wide rather than under your account only. My web host doesn't allow server-wide installations in their shared environment for security reasons and because they want to keep their fleet universally the same across the board. I suspect your host is the same.
However, they did suggest I download, configure and install the pecl package (pecl_http) in my account only (rather than server-wide) via the following manual process:
$ cd ~/
$ wget http://pecl.php.net/get/pecl_http
$ tar -zxvf pecl_http.tar.gz
$ cd pecl_http
$ phpize
$ ./configure --prefix=~/bin
$ make
$ make test
$ make install
A successful install will have created extname.so and put it into the
PHP extensions directory. You'll need to edit php.ini (in my case,
this was a copy of the standard php.ini file that I placed in the same
folder as the script using the extension) and add an
extension=extname.so line (in my case, extension=http.so) before you can use the extension.
http://www.php.net/manual/en/install.pecl.phpize.php
Note that the tilde character (~) in the above code refers to the home directory of the current user (e.g. /home/username on my host's server).
Issues you may run into
When using the tar command, a "cannot open: not a directory" error
appeared as pecl_http had been downloaded without a file extension.
This was easily corrected:
mv pecl_http pecl_http.tar.gz
When using the make install command, a "cp: cannot create regular
file...: Permission denied" errror appeared. I resolved this issue
by changing the ext_dir for pecl...
pecl config-set ext_dir /home/username/bin/extensions
...and re-running make install. I also had to copy the http.so extension to /home/username/bin/extensions and then reference that location in my php.ini file:
extension_dir = "/home/username/bin/extensions"
this sounds like you don't have root access to your server. if your need to compile anything you must be have root access permission to server, or maybe you must be one of the sudoers.

Magento refuses to upgrade 1.4.2.0 ===> 1.5.0.1

This is my first time using Magento. I upgraded this site from 1.4.1.1 to 1.4.2.0 without issue. Now trying to go to 1.5.0.1 it just seems to refuse at every turn. I tried by entering this key into Magento Connect:
magento-core/Mage_All_Latest
And it says this:
Ignoring installed package magento-core/Mage_All_Latest
Nothing to install
I tried to upgrade via SSH and got this:
Attempting to discover channel "magento-core"...
unknown channel "magento-core" in "magento-core/Mage_All_Latest"
invalid package name/package file "magento-core/Mage_All_Latest"
Cannot initialize 'magento-core/Mage_All_Latest', invalid or missing package file
Package "magento-core/Mage_All_Latest" is not valid
install failed
In the downloader I noticed a the downloader had a version 1.5.0.0 upgrade available. I thought maybe I needed the newest downloader before I could update all the packages. I upgraded just the downloader to 1.5.0.0 which worked. Then I tried the full upgrade again and now it is mega retarded with this:
Couldn't resolve host 'magento-core'
That’s cute isn't it? So I gave it once last whirl at the ssh console and i get this bad boy:
Attempting to discover channel "magento-core"...
Attempting fallback to https instead of http on channel "magento-core"...
unknown channel "magento-core" in "magento-core/Mage_All_Latest"
invalid package name/package file "magento-core/Mage_All_Latest"
install failed
I tried a forcing it via SSH but still no love. I reverted from a backup I made so I do not have downloader 1.5.0.0 any more. Now of course I am back to square one with it telling me there is nothing to install when I try to update via MC.
When I check in MC if there are any updates available it lists these two:
Mage_All_Latest Upgrade to 1.4.2.1 (stable) Metapackage for latest Magento 1.4 release
And the Mage Downloader 1.5.0.1 but I already installed these before and it did no good so I restored my backup before the failed update.
I was trying to ask this question Magento's Forums but they are a mess right now. Their captcha fails and threads close on their own so you get little to no help. I wouldn't be surprised if they did this on purpose in concert with their 1.5.0.1 release.
Go to the root of your website and execute these commands (Where index.php is):
wget http://www.magentocommerce.com/downloads/assets/1.5.0.1/magento-1.5.0.1.tar.gz
tar -zxvf magento-1.5.0.1.tar.gz
Skip the next 4 commands if you have your magento install in a folder called Magento:
cd magento
cp -rf * /home/bitscom/public_html
cd ../
rm -rf magento
rm magento-1.5.0.1.tar.gz
For a detailed explanation see my post on the offical magento forum: here My name is Veracious on there.
If your SSH account is anything other than your apache user (i.e.: root. you will get error 500 when trying to access the site do the the permissions on the new files you just extracted. To resolve that use chown and chgrp. For a detailed explanation once again see my post:
here
I think the location for the upgrades have changed. Instead of the:
magento-core/Mage_All_Latest
use:
community/Mage_All_Latest
As what mrdon has mentioned.
I couldn't upgrade through Magento Connect either. I followed these instructions for installing magento and it worked fairly well. I changed line 3 as below to copy the folders/files over my existing ones.
wget http://www.magentocommerce.com/downloads/assets/1.5.0.1/magento-1.5.0.1.tar.gz
tar -zxvf magento-1.5.0.1.tar.gz
cp magento/* magento/.htaccess .
chmod -R o+w media var
chmod o+w app/etc
I followed the instructions from the following post to upgrade from 1.4.1.1 to 1.5.0.1:
http://www.magentocommerce.com/boards/viewthread/219720/#t301761
Then flushed the cache and reindexed everything. Everything worked.
Don't forget to change magento folder ownership to your web server user. In my case I had to run
chown -R www-data:www-data /var/www/magento

Simple Unix question - Configure

I'm using Solaris 10, ksh. Whenever I do a ./configure, I get the error "ksh: ./configure: not found"
When I do a "where configure", nothing is found.
How do I "install configure"?
./configure means that you want to run an executable called configure in your current directory (signified by a .). I'm guessing you're trying to build and install from source, and the directions say to do the standard ./configure; make; make install. You should do that from the top-level directory of the source you downloaded and unpacked:
$ cd /path/to/source
$ ./configure
$ make
$ make install
"./configure" means "run the program configure from the current directory". That is, you need to cd to the directory that configure lives in before attempting to run it like that.
As for where configure might be found, it's usually at the root of whatever source package you're trying to build.
I'm not a Solaris guy, but the configure script should be within your current directory before you execute it. I am assuming you're trying to build something. If it's a project of your own, take a look at GNU autoconf. (I have no idea if this a part of Solaris or not.) It's part of M4.
If it's a project that you downloaded, untar/unzip/unpack it and then cd to its directory before running the configure script.
I had to run a command for another directory; and then that popped everything up :)
In case someone else comes across this specific issue, I'm trying to install the Perl-Php plugin on a Solaris machine. Initially, there is no configure file; instead you have to find where your "phpize" is located -- for me it was /opt/webstack/php/5.2/phpize, run it while you are still in the "perl-php-plugin" folder, and then configure will appear.
Then you can ./configure :)
Thanks to everyone who responded.