W
W
wartur2012-10-09 13:16:12
linux
wartur, 2012-10-09 13:16:12

Problem running PDO in PHP via CLI?

Hello.
Actually the problem is the following.
There is a php script, or rather, even the Yii framework executable in console mode. I'm running it through the command line, which in turn wants to load the PDO extension in order for Active Records to work.
When run as root. Everything is fine with me, the launch is happening, the creation of the PDO class and off we go. It turns out php.ini for CLI is configured correctly?
Next, of course I want to run as the end user, for example www-projectname, so that the new files that are created when working in console mode are from the same user that also works in mod_php (web) mode.
This is where the problem arises.
When run as an end user, the PDO class does not exist. It turns out the module is not loaded.
Please note that such problems do not occur when working in normal mod_php mode. PDO is loaded from the same www-projectname user, and of course from root.
In general, I am completely confused and I need qualified help from the host community. Please help me solve this problem.
Here is how I run the script. I have debian squeeze, I installed everything from packages.

/usr/bin/php5 /home/[www-projectname]/[path/to]/yiic controller action<br>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lubezniy, 2012-10-10
@lubezniy

I don’t know how it is in squeeze, but in altlinux php.ini for cli and apache2-mod_php are different. Maybe the loading of this module is not registered in the first one (if this is also the case in squeeze)?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question