So I'm new to Laravel 4, and I'm trying to figure out how to Symlink two parts of my site.
The first is apps/storage
The second is public/cache (this is where an image cache is stored)
I'd like to move both of these to a SSD on my server, however Laravel keeps throwing out an error whenever I try and setup these Symlinks.
That error is:
ErrorException
file_put_contents(/meta/services.json): failed to open stream: No such file or directory
Clearly it's unable to find the filesystem and the symlink isn't working with Laravel. But the symlink DOES work with individual files (such as a jpeg), so I'm positive there is no problem with the initial setup.
To clarify, the document root is set to httpdocs/public (via Plesk settings)
The apps (and framework) are located in the httpdocs folder which is no longer serving as the vhost root.
As I hinted at, it's a Plesk server. The owner belongs to the vhost, and the group belongs to psacln. But I don't think there are any permission/ownership problems, as I've verified the symlinks are working.
Looks like you have messed something else, because the path in the error message looks wrong to me:
file_put_contents(/meta/services.json)
IMO, it should be something like:
file_put_contents(/var/www/webapp/app/storage/meta/services.json)
Because, if you have done the symlink correctly you did something like
mv /var/www/webapp/app/storage /mnt/ssd/
ln -s /mnt/ssd/storage /var/www/webapp/app/storage
PHP is trying to write a file in the root /meta folder, where probably it doesn't have right.
Related
I just copied my laravel project from one pc into another. I changed the .env file accordingly for new domain url (it's in localhost bytheway).
However when I click the links, namely login, register, they say the requested URL not found on this server.
I tried to run php artisan serve command, but it says
[Error Exception] No such file for directory.
But the artisan file is there. I'm afraid the domain still pointing to previous one, hence the error.
Is there anywhere else I need to change the pointing url?
After copying the directory you should always run composer update secondly make sure you have.
i fixed it by enabling module rewrite option in apache extension in WAMP
I have a VPS of blueMix, My cPanel's file Manager have folder public_html where i dropped a file index.php having some php echo 'tesing'; which wasn't loading up, After some research i found out that my root Directory is /var/www/html. But any how i dropped my project there like /var/www/html/project and then came up checked like example.com and that redirected me to the hosting default page, example.com/project show project root files and folders, example.com/project/public returned internal server error 500. Permissions seems ok.
What am i missing, Is there a slandered way ? Please help out.
Q1 : How can i set my root directory public_html.
Q2 : How to deploy laravel in /var/www/html or public_html.
modify this Lines from Public->index.php to the public_html .
require __DIR__.'/../public_html/bootstrap/autoload.php';
$app = require_once __DIR__.'/../public_html/bootstrap/app.php';
and check..
After hours of research, I easiest way is to have a server with out a lamp stack, Install a custom lamp stack, One by one component, Look for the apache configuration, Set the permissions, And you are good to go.
I'm very new to Yii, so please bear with me. I've an existing XAMPP setup on my MacBook, and an existing project I need to take a look at. At first the project was looking for a yii.php, so I downloaded the appropriate version (1.1.17), and extracted that to /htdocs/.
I renamed it to yii, and set the yii directory in my index.php to:
$yii=dirname(__FILE__).'/../../yii/framework/yii.php';
For reference, the project has the following directory: htdocs/cdforum/web/index.php
With everything in place, or so I think, I started up XAMPP, and loaded http://localhost/cdforum/web/index.php only to encounter the following error:
throw new CException(Yii::t('yii','Application runtime path "{path}"
is not valid. Please make sure it is a directory writable by the Web
server process.'
I have seen some people get past this by setting the yii folder's ownership via chown to their own, or apache, but the first option didn't work for me, and apache apparently is an illegal user name.
Anything else I can try?
Change your username:group in httpd.conf file of Apache:
About line ~181-182:
To your user in your Mac.
Don't change the Apache User and Group. There are very good reasons why Apache has it's own user and group. Here's a simple example of what can go wrong...
While developing you make a mistake in your app and delete files
recursively in a directory, this directory has a sym link that you
follow into your home directory and you delete everything in your home
directory. This cannot happen if the users are different.
In production if you changed the owner of the user/group to a real user account the you'd almost certainly incur the wrath of the OPS department ie you're creating a security hole, a bad one.
The correct thing to do is to do what it asks ie make the directory writable by the apache process ie use chown or chmod. If you are developing then use this, in production this is also bad...
chmod 777 ./path/to/directory
In prod the directories apache need to write to would either have group write permissions for the apache user or be be owned by the apache user. Only those directories that it requires write access to, nothing else.
I wrote a little site with Symfony2 and I want to host it on my WebSpace. I only have FTP access, so I can not access any console/terminal!
Problem is: Symfony cannot create the cache directory properly! There might be a permission problem still?!
These are y steps so far:
Uploading my whole project with empty Cache directory (since I can't clean it due to no console)
Changing permissions of cache and logs directories using my ftp client
unmasking console, app.php and app_dev.php like explained here
Adding my IP to the whitelist in the files: config.php and app_dev.php
Checking the config.php to see if my configuration meets symfony's requirements (they do! no major problems!)
Checking PHP settings: PHP 5.3.3-7, SQLite3 and PDO-Driver there!
Opening app_dev.php/_configurator/step/0 concludes into a RuntimeException:
RuntimeException: Unable to create the cache directory (/var/www/userx/html/MySiteSymfony/app/cache/dev/twig/83/4c).
Opening app.php results in a 500 server error and no log file is being created
Someone an idea how to get symfony working?
Go into the app/ folder click "get info" on the cache folder and set the right permissions (make sure to click "Apply to enclosed folders/files").
Finally changed my provider. Seems like its OS was just deprecated.
I'm on a Windows machine. This seems like it should be unnecessary, but when I do it, everything suddenly works. Is there something wrong with my path? Do I need to add something to it to avoid having to copy DLLs?
Apache like any application will assume that the file is located in the same directory as the Current Directory path (check out http://en.wikipedia.org/wiki/Working_directory). If it's not there. The current working directory is USUALLY the same directory that httpd.exe (main executable) is in but it can actually be different if you do something like
C:\Apache2>bin\httpd.exe
In this case the Current Working directory is C:\Apache2 rather than C:\Apache2\bin.
If if the file isn't found there the application will naturally traverse the PATH environment variable. The PATH environment variable is a semi-colon or comma separate list of paths) to find the file.
Start -> Run -> Type "cmd.exe" and then in the Command Prompt type "echo %PATH%" to see the current path you have.
Finally, if the file wasn't found it will just error out.
As a tip you can actually track what files an application is trying to load and where they load them from by using Process Monitor. http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
I've used this tool to solve load DLL problems in Apache before and other applications as well. Just simply add a filter for the app you are running and have it only sniff out file reads.
I donot know the internals of MySQL and apache.
My thought is this. Internal of your application is using libmysql.dll. And it seems that path is not proper so it searches in PATH environmental variable. apache/bin will be there in PATH directory. So it is taking the dll from this path. If the dll is not present in that path I think it fails to load and hence fails.
EDIT: Added the solutions which were added in comments
Try rebooting your machine. I had the same issue with mysqlpp library. Path was pointing to mysql bin dir but it still couldnt find libmysql.dll – Daniel (Jan 26 at 6:55)
Apache might be running with credentials different from your own (almost certainly so if you're running it as a service.) Try placing the dirs in the SYSTEM path, not the USER path. – moocha (18 hours ago)