Laravel4 not installing correctly - laravel

I'm trying to install Laravel4 in a ubuntu.
But each time I try to make it work following the install instructions, I receive an error in the php pages.
Any ideas where I should look for?
After clean install, when I launch the site I receive this error :
Parse error: syntax error, unexpected $end in /mnt/hgfs/www/......./vendor/patchwork/utf8/bootup.utf8.php on line 309

I got some troubles too. The probem I had come from the fact the entire project files do not had correct rigths.
Try this in your root application folder:
find ./ -type d -exec chmod 775 {} + && find ./ -type f -exec chmod
664 {} +
Hope it helps.

Related

Capistrano 3: "find ... -exec ..." command syntax in task

I am trying to integrate this shell command into a Capistrano 3 after deploy task:
find /var/www/mysite/somepath/ -type d -exec chmod 775 {} \;
However, I am failing at the proper Ruby syntax. I have tried most conceivable combinations between:
execute :find, "#{deploy_to}/somepath/ -type d -exec chmod 775 {} \;"
and
execute :find, "#{deploy_to}/somepath/", "-type d", "-exec", "chmod", "755", "{}", ";"
but invariably end up with the error: find: missing argument to -exec
Could anyone please help me with the proper way to separate the arguments of this command?
You are using wrong commands, :find is for using ruby functions, but you want to use find of linux utilities. Please try following
execute "find /var/www/mysite/somepath/ -type d -exec chmod 775 {} \\;"
Don't forget in the last I have double slashes to terminate command. But there is more good way to do it using following commands
set :file_permissions_paths, ["app/logs", "app/cache"]
I was using it in my very old project like following
set :permission_method, :chmod
set :use_set_permissions, true
set :writable_dirs, ["app/cache", "app/logs"]
set :file_permissions_paths, ["app/log", "app/cache", "storage"]
I think don't set permission of everything is really good idea, but when I did first time I was also getting confused so long time ago I have used following task which will go throughly and change all permission as you wanted
namespace :deploy do
task :check_permissions do
on roles(:web) do
execute "chmod -R 0777 #{release_path}"
execute "echo 'finished'"
execute " /bin/systemctl restart nginx"
#execute "cd #{deploy_to}/current && /usr/bin/env rake countries:update RAILS_ENV=production"
end
end
end
It has many things you remove and try what you want to do. Please note these are very old code, even I don't remember what are they doing, as I am not using capistrano any more to deploy but mostly dockers.

Laravel installation with sudo permissions

I have laravel up and running on my Ubuntu 16.04 LTS and have installed laravel at /var/www/ however, I am concerned with why I have to sudo to make any changes to the folder files which is a bit annoying as I have to run sudo subl . in my directory to be able to work.
Unfortunately I also installed with sudo composer which only after I realised this was a bad move.
Is there a way to either move my installation so that I do not have to sudo to edit changes or is there a better way to do it? Shall I uninstall, delete directory and start again from a usr folder or local folder.
Furthermore I cannot run gulp from this directory which is in my home/node_modules. Should I start again and keep a folder in my home directory or is there a better way to do it in var/www/?
You don't need to use sudo (root) do do anything like serving a page, or worse, stop using root to do things like that on your servers, the more you do that, the less secure your server is becoming. You just need to ensure the webserver has access to your files (mostly reading rights), so two things may happen here:
1) Set your files to be readable by your webserver (www-data?) doing
DIRECTORY=/var/www/yourapp
YOUR_USER=antoniocarlos
sudo find $DIRECTORY -type d -exec sudo chmod 750 {} \;
sudo find $DIRECTORY -type f -exec sudo chmod 640 {} \;
2) Make sure the storage path is writable by the group
sudo find $DIRECTORY/storage -type d -exec sudo chmod 770 {} \;
sudo find $DIRECTORY/storage -type f -exec sudo chmod 660 {} \;
3) Make sure the folder is owned by the proper user and group
sudo chown -R $YOUR_USER:www-data $DIRECTORY
Then you should be able to just do things like
composer require package/name
php artisan make:whatever
All without sudo, and your webserver will be serving your page too.
replace {username} with your actual username
sudo chown -R {username} ~/.composer/
You have to change the owner of the www folder to your user like so
sudo chown -R you_user:your_user /var/www

Jenkins appears to be skipping permissions setting commands

We are using jenkins to deploy our application. When there are only a few files uploaded on the website it works perfectly fine. Where there are quite a few files (currently we have approx 3.9GB) jenkins appears to skip the command which set the permissions on the files and folders. These are the 2 commands from the bash script in question:
sudo find /path/to/web/root -type f -exec chmod 660 {} \;
sudo find /path/to/web/root -type d -exec chmod 770 {} \;
We can tell the commands aren't running as the site serves 403 errors on the files when accessed.
When we run the command manually afterwards it runs absolutely fine (although it does take about 2-3 mins to run the first one)

Showing error "Connection string is empty" in magento

When i am installing an extension in my magento admin,it shows Connection string is empty.
I don't know why this problem occurs. I cleared the cache also then also the problem is same.
If anyone knows how to do this,please help me out.
Thanks!
To solve this problem, follow the steps below (I suppose you are using Ubuntu):
1) sudo chmod -R 777 /var/www/html/magentoInstallationFolder/
2) Install Magento Extension
3) Restore correct permissions for directories and files respectively
sudo find /var/www/html/magentoInstallationFolder/ -type d -exec chmod 775 {} \;
sudo find /var/www/html/magentoInstallationFolder/ -type f -exec chmod 664 {} \;
Read more about why 777 permissions are bad and you need to restore good permission code (775) after you install the extension: https://askubuntu.com/a/30635
Magento tries to put the maintenance flag in the root directory. Here is the code that does it:
<?php
//downloader/Maged/Controller.php::startInstall()
if ($this->_getMaintenanceFlag()) {
...
//downloader/Maged/Controller.php::isWritable()
$this->_writable = is_writable($this->getMageDir() . DIRECTORY_SEPARATOR)
If you can't change magento root directory permissions just uncheck "Put store on the maintenance mode while installing/upgrading/backup creation" flag.
There's a couple of suggestions to change the permissions to this:
sudo chmod 777 -R /var/www/html
Which is a really really bad idea. Have a search for 'Magento permissions' and follow the guide instead. Unless you're seeking to get your site hacked wihin a few minutes.
Have to change right recursively (chown -R) to www-data:www-data on a directory containing magento (example : /var/www/magento)
Sorry for bad engish
chown -R www-data:www-data /var/www/your_magento_folder
That did the tick for me, don't change the owner of the www folder
Type the following command in your terminal.
sudo chmod 777 -R /var/www/html/<magento folder name>. Press Enter.
Then it will ask for password if exists for your username.
Once it is done, login and logout the admin and try to install extension which you want
Edited:
Try this for your files:
sudo chmod 777 -R /var/www/html
and follow the above steps.

Magento Connect install Error moving uploaded file

I have problem with magento connect. i am not able to install any downloaded packages of magento extensions like mailchimp, onestep checkout package.
While i am uploading package, its shows error like Error moving uploaded file
i dont know what to do. please help me..
Thanks
The solution to this problem is to set all folders permission to 777.
Go to your installation root folder and run the following command (You should have access to SSH on your server to run this command):-
find . -type d -exec chmod 777 {} \;
Now you will not get the error on Magento Connect Manager and you will be able to install any extension from there.
Don’t forget to change the folder permission to 755 after you are done with installing your extension from Magento Connect Manager.
To do this, run the following commands:-
find . -type d -exec chmod 755 {} \;
chmod 777 var var/.htaccess app/etc
find var -type d -exec chmod 777 {} \;
chmod -R 777 media

Resources