3

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?

2 Answers 2

3

Change your username:group in httpd.conf file of Apache:

About line ~181-182:

Screen shot in my computer

To your user in your Mac.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you. That worked. Of note is that, for some reason, locate says I've got multiple httpd.conf files, but the one that worked was /Applications/XAMPP/xamppfiles/etc/.
Yeah, it's depend on what apache your web is running on, Mac also have build in Apache2 ;)
3

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.