I have just installed a fresh copy of Yii2 advanced and am having trouble getting the style sheets to load. The error seems to be that Yii (or webserver) cannot create path /var/www/frontend/web/assets/1ecfb338/css despite doing so in the same http request that it errors. Even after reinforcing file permissions of 777 from without and outside the VM, Yii doesn't seem to make further attempts to write the stylesheet.
If I just refresh the page loads without error but the stylesheet bootstrap.css has not been created in the directory.
This is most frustrating. Does anyone have any ideas?
If it matters I am running Yii in a Vagrant VM with Virtualbox. Debian is the VM OS and Ubuntu is the host.
This is quite strange at not experienced this before. I was able to correct this by changing the mode to 777 as the super user from outside the virtual machine. From doing the same thing inside the virtual machine made no difference.
I have worked on many projects before with this kind of setup but not had this before. Software that I'm using that may be responsible is:
Host machine:
Ubuntu 14.04
Vagrant 1.7.4
Virtualbox 4.3.30
Virtual machine:
Debian Jessie
Nginx 1.6.2
PHP 5.6.14
Edit: I found that I had defined the sync folder incorrectly. I had to change to rule this this:
config.vm.synced_folder "./", "/var/www", id: "vagrant-root", :group=>'www-data', :mount_options=>['dmode=775,fmode=775']
You just give permission for particular directory like:
sudo chmod -R 777 /var/www/frontend/web/assets
The solution for me was adding
sed -i 's/www-data/vagrant/g' /etc/apache2/envvars
to the Vagrantfile like written here
Vagrant file_put_contents permission denied
Related
enter image description herei'm using centos to host my laravel application,
when i upload the project first time using git, it will be cached, and when i change any file, changes doesn't apply, i tried all artisan commands that clear cache in laravel but didn't fix
the only way is to change the root directory of the application after each single change, is centos caching or nginx or laravel or other software in the server or the browser? even i cleared every thing in public/index.php and put echo 'foo'; and still got old cached data
screenshot of my nginx config file
screenshot of my nginx config file
This is possibly directory permission issue you need to grant storage and bootstrap directory 777 permission level. You need to run the following command on the root folder of your app
chmod -R 777 storage
and
chmod -R 777 bootstrap
Then try to effect your changes.
i tried systemctl restart php-fpm now every thing worked as expected and all changes applied thank you a lot i appreciate your help
First of all, according to stackoverflow, this problem occurs when something is wrong with permissions of bootstrap/cache and storage directories. And I tried literally every advice on that with no luck.
I was happy user of Xubuntu 16.04 at my old laptop, developed one project. Using docker-compose to set up development environment. Yesterday I bought brand new PC, installed Kubuntu 18.04, installed docker and everything I need to work.
Cloned repository, ran composer install, docker-compose up, then php artisan migrate and php artisan storage:link. But when I try to open website in browser, I get 500 error with empty body response.
APP_DEBUG is set to true.
6 hours later I'm here with literally zero results. Tried dozens of solutions found here and on forums (just example).
I even did a little experiment: removed project directory from my old laptop, cloned it from scratch, installed everything required and it worked. Without any permission problem.
And what kills me more: there are no logs inside docker containers, no logs inside laravel directory, just nothing.
Please help! What's wrong? Maybe it's Kubuntu? Maybe it's 18.04? Maybe it's newer docker version?
P.S. Right now bootstrap/cache and storage directories are owned by alex:alex and has 775 permissions. Exactly same as at my laptop.
Add a dd($exception->getMessage()); to the exception handler class right before line 37. Run the request and check the response.
If that doesn't avail anything, verify the request is hitting the webserver by checking access and error logs. Check system logs also using dmesg and similar.
Since you mention Docker, if you're using nginx, be sure your site configuration is not being overwritten when running docker-compose up.
Looks like error is probably either related with storage permissions that should be 777, or with ownershp, or with app's bootstrap, before it even runs your files, when it pulls out configuration setup.
Check the .env configuration, and config files in config directory for any errors.
For storage switch to 777 permissions
chmod -R 777 storage
For configuration issues, try first with
php artisan config:clear
From the console.
If you are on linux server it may be selinux permissions.
Try setting selinux as passive:
in terminal type:
setenforce 0
then see if you see errors. If it works as should you want to turn selinux back on:
setenforce 1
Then give directory writable with selinux command:
chcon -R -t httpd_sys_rw_content_t /path
I am trying to install Laravel for first time. I installed it on my desktop with the following composer command
composer create-project laravel/laravel laravel-app
The command completed successfully without any error but with some messages like
symfony/var-dumper suggests installing ext-symfony_debug ()
symfony/translation suggests installing symfony/config ()
I now did chmod -R 777 larvel-app to make whole folder writable by everyone. I now started php server with following command
cd laravel-app
php artisan serve
and it gave following message
Laravel development server started on http://localhost:8000
When viewed from web browser in address http://localhost:8000, there is nothing, only blank page. When I browse this address, the server seems to quit.
I have following environment:
OSX Mavericks;
MAMP with php 5.4.10 and apache2;
following extensions in php.ini file
extension=imap.so
extension=yaz.so
extension=mcrypt.so
extension=gettext.so
extension=pgsql.so
extension=pdo_pgsql.so
extension=pdo_mysql.so
;;;;;Following are added by me ;;;;no error when starting server
extension=openssl.so
extension=mbstring.so
When I run which php from command line, I get following.
/Applications/MAMP/bin/php/php5.4.10/bin/php
When I tried to run this in mamp ie localhost:8888, it gave 500 internal server error.
Please suggest me, where I might have made mistake.
As a OSX user i strongly recommend you to use Laravel Homestead to develop your applications.
http://laravel.com/docs/5.0/homestead
You only need to install:
Virtualbox
Vagrant
I have my projects in ~/code folder, so everytime i create a new project, i just:
Add project test domain to my local host file (my-project.app pointing to localhost 127.0.0.1)
ssh into the homestead virtualmachine (homestead ssh)
run built in serve command (serve my-project.app /path/to/project/public)
VoilĂ
The most common reason for this is that the web server process does not have write access to the storage folder and its subfolders.
Set the permissions on the storage folder so that the web server can create files.
You don't have to use php serve, mamp does that for you. Make sure you point your directory to public folder. You can also use custom domain for each of your projects.
Also for Mac there is laravel valet. Easy to get started with many php projects.
I think you should move your Laravel Application to
/Applications/MAMP/htdocs/
and then you can access it on
http://localhost:8888/laravel-app
I know that this is a very common question to find asked, but I'm having serious difficulty with this on my AWS Ubuntu 12.04 instance.
I installed PHPMyAdmin using apt-get with the command sudo apt-get install phpmyadmin and it installed just fine. I can use PHPMyAdmin as it is on the instance.
I'm trying to generate a config file using the setup wizard, and I followed the steps as documented on the PHPMyAdmin website to set that up. I created the config directory in /usr/share/phpmyadmin and gave it world write access using sudo chmod 777 config. Despite all of this, PHPMyAdmin still tells me that my config directory is not writable.
I then tried to create a config directory in /etc/phpmyadmin which also had world write access and I'm still not having any luck!
Can anyone please tell me if I'm missing something here? I don't know what else I can try to get this working.
I found it!
My config directory is actually /var/lib/phpmyadmin.
I found this from the index.lib.php file in /usr/share/phpmyadmin/setup/lib. There's a function in there called check_config_rw() which checks the Config directory based on the currently used config.inc.php file. Changing the permissions on this folder and its contents to make it www-data writable solved my problem!
While following the "Practical Symfony" course, I have run in a strange error.
I have installed a Debian Squeeze in a VMWare 6.5.5 machine. It comes with PHP 5.3.3 and I am using Symfony 1.4. The source files are on the host, I am accessing them using the shared folder feature (vmhgfs mount).
Now, when I try the following commands, I get an error:
php symfony doctrine:build --model
php symfony doctrine:build --sql
Error:
PHP Parse error: syntax error, unexpected ')' in /var/www/appli/lib/model/doctrine/base/BaseJobeetJob.class.php on line 144
What is funny is that when I :
- do the same thing without the shared folders (e.g. on a ext3 partition), it works,
- convert the VM to VirtualBox and do the same thing on a shared folder, it works,
- downgrade the PHP to 5.2.6 (from lenny), it works.
I remember having the same kind of issue some time ago with the PHP code generated by Smarty. As it was automatically generated PHP and could be regenerated at will, I had it generated in a local direcorty. But I do not think this is applicable to Doctrine generated files.
Does anyone have any clue of what is happening and how I could fix it ?
EDIT: here is the code around line 144:
public function setUp()
{
parent::setUp();
$this->hasOne('JobeetCategory', array(
'local' => 'category_id',
'foreign' => 'id',
'onDelete' => 'CASCADE'));
$timestampable0 = new Doctrine_Template_Timestampable();
$this->actAs($timestampable0);
}
} // Line 144 here.
It is actually the end of the file...
EDIT #2: to make it clear I have tested the following combinations in order to narrow down the issue:
VM software : VMWare Workstation
6.5.5 / VirtualBox 4.0.8
PHP version: 5.3.3 / 5.2.6,
Mount type : vmhgfs (or vboxsf with VirtualBox) / ext4 (local)
/ cifs (aka Windows share).
In every case I am using the very same source files (but for ext4 because I had no other choice than to copy them). I have a failure when combining the bold items. If I change any one of them, everything goes fine. I also tried to use the open-vm-modules in place of the provided vmware tools and to build a Debian installation from scratch instead of using my own automated script but neither has changed anything.
This seems to be a bug in vmhgfs - I have the same issue working with Drupal PHP code. It also seems to only happen when the files are added to the host from the guest, for example using git to clone a repository in the Linux VM.
There are three workarounds:
Copy the files into their desired location, then disable shared folders in VMWare settings for the virtual machine, refresh the web page so you get 'Not found', then re-enable shared folders.
On the host machine, run the following command which updates the file access / modified timestamps for every file, thus causing the VMWare driver to reload the file, fixing the issue:
find . -exec touch {} \;
Open the affected file from the host machine, modify it, and save it back. This may be useful if you're on a Windows machine.
The errors range from PHP Parse errors to others, normally flagging the last line of the file.
I have the same problem on OpenSUSE 11.4 with PHP 5.3.5 using vmhgfs (on a Mac). I am also using doctrine, however I am using it without the full symfony project.
Initially vmhgfs didn't work at all, so I downloaded the open-vm-tools and compiled/installed that. That solved my problem for a few weeks, but it came back today.
The issue appears to be php reading past the end of the file. If I read the file with cat, less, or tail, then the end of the file looks fine.
But if I do php -s bad_file.php > bad_file.php.html and look at the html output, I can see at the end of the file there is some extra garbage that I don't see with with cat, less, or vim.
You can see that php sees "array (" at the end of the file, while other tools do not see that.
The only solution I've found is to manually add a new, blank line at the end of each problematic file. For some reason it only affects 1-2 files out of about 40.
Same problem here. I confirm that it is a vmhgfs problem.
A workaround is to use a NFS share instead of vmware shared folders:
Linux env
apt-get install portmap nfs-common nfs-kernel-server
mkdir /nfs-share1
echo "/nfs-share1 192.168.2.1(rw,sync)" >> /etc/exports
/etc/init.d/portmap start
/etc/init.d/nfs-kernel-server start
/etc/init.d/nfs-common start
usermod -u 501 paolo
find / -user paolo -exec chown paolo {} \;
OS X env
showmount -e 192.168.2.129
mkdir /Users/paolo/netshare1
mount -t nfs -o resvport,soft,intr,rsize=8192,wsize=8192,timeo=900,retrans=3,proto=tcp 192.168.2.129:/nfs-share1 /Users/paolo/netshare1/
Ugh! Finally I figured it out. I'm using VMware Fusion (4.0.2) on Mac OS X Lion (10.7.2) and I've been pulling my hair out trying to figure this out.
Upgrade your VMware Tools!
So far, so good: Haven't encountered the problem again. The latest release at this time is VMware Tools 8.0.0.
Well, this might be off topic, but I hope it helps:
I am working on the same book, and I have done this (I think you'd better do something like me):
Installed Ubuntu Server inside VirtualBox
Installed LAMP Server on Ubuntu
Installed vsftpd, for ftp access on Ubuntu
Installed SSH server on Ubuntu.
Now, if I am on Linux host, I use Aptana Studio with ftp access for editing files and SSH to run commands, and if I am on Windows, I use Aptana Studio and Putty for SSH access.
If you do something similar, you will probably have no trouble.
Hope it helps.
I am also experiencing this problem in regards to Wordpress and Laravel. To fix the problem, I have to remount the mounted folder from the guest.
For instance, all my source files are located on the host (OSX) and shared to Ubuntu (guest) with vmhgfs. The mount point is /mnt/hgfs/www. To remount:
sudo mount /mnt/hgfs/www