Hiphop error when running program had compiled
Asked Answered
A

1

11

I have succeed when using Hiphop to try compile a simple yii app (generate with cmd yiic webapp demo).

hphp test.php --keep-tempdir=1 --log=3 --include-path="../yii/framework"

Compile-processing is not has any error or warning. I can start server with compiled-program with cmd:

sudo /tmp/hphp_8AcATe/program -m server -p 8008 -v "Server.SourceRoot=pwd" \ -v "Server.DefaultDocument=index.php" -v "Server.EnableStaticContentFromDisk=true" -c $HPHP_HOME/bin/mime.hdf (This cmd refer from here - Example: Compiling WordPress)

After that, I access by browser via http://127.0.0.1:8008 and then meet errors:

UPDATE (I have confusion in path below and fixed)

HipHop Notice: Tried to invoke /var/www/demo/../yii/framework/yii.php but file not found. in index.php on line 12

HipHop Fatal error: Required file that does not exist: /var/www/demo/../yii/framework/yii.php in index.php on line 12

Here is line 12, index.php:

4.  $yii=dirname(__FILE__).'/../yii/framework/yii.php';
...
12. require_once($yii);

UPDATE

I've tried with realpath() as @prodigitalson's hint, but in console, program still output the same content :

Required file that does not exist: /var/www/demo/yii/framework/yii.php in index.php on line 12

To avoid in relative path confusion case, I copied compiled program folder to /var/www (root dir with yii lib: /var/www/yii/framework), but nothing change :(

Have anybody meet this error the same to me? How to fix them? Thank for you help!

Aliquot answered 22/6, 2012 at 3:48 Comment(10)
can you post line 12 of your index.php so we can see your require statment? It looks like the path is being resolved incorrectly.Memorabilia
@Memorabilia I have updated my question with code at line 12.Aliquot
So does file /var/www/demo/../yii/framework/yii.php exist?Jacal
@Jacal Of course, I've worked with Yii for some time.Aliquot
@Davuz: just to be sure check it with cat /var/www/demo/../yii/framework/yii.php in shellJacal
@Jacal run cat ... ouput to screen content of yii.php. Is it ok?Aliquot
@Davuz: dont use an unresolved relative path... wrap it in realpath: $yii = realpath(dirname(__FILE__).'/../yii/framework/yii.php');Memorabilia
@Memorabilia I've tried with realpath(), but in console, program still output the same content : Required file that does not exist: /var/www/demo/yii/framework/yii.php in index.php on line 12Aliquot
and what happens when you do an ls -al /var/www/demo/yii/framework/yii.phpMemorabilia
Have you tried to access the file "/var/www/yii/framework/yii.php" directly? Does it work then?Fleetwood
B
1

get rid of '/..' from '/../yii/framework/yii.php'

Baklava answered 10/7, 2012 at 8:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.