Encoding cannot be loaded - phalanger

I'm having a problem with Phalanger 3.0 running as a console app on Mono 4.0.1
Program.php
<?php
echo 'Hello world';
?>
Compile
$mono phpc.exe Program.php /out:Program.exe
Run
$mono Program.exe
Output
Encoding cannot be loaded.
fileEncoding=""
Hello world
Is there any configurations am I missing or is it normal?

Related

Fatal error running unit test in Yii app

This Question is local to my situation and not resolved (yet). But if you are experiencing this problem, the trouble shooting steps may give you a good path to start on.
I want to run a unit test in a Yii web application on localhost, which is running via WampServer 2.1 on Windows 7.
<?php
class LittleTest extends CTestCase
{
public function testApprove()
{
$value1 = "1";
$this->assertEquals($value1,$value1);
}
}
?>
I receive a fatal error when I try to run the test. Here is how I run it, on the Windows command line:
C:\wamp\www\app\protected\tests>
C:\wamp\www\app\protected\tests>cd unit
C:\wamp\www\app\protected\tests\unit>phpunit LittleTest.php
I receive (along with some stack trace lines):
PHP Fatal error:
class 'CTestCase' not found in [path to file]\LittleTest.php on line 4
Trouble shooting steps to this point:
The app runs. The default index page of the app looks good and I have used the gii tool to create a model class.
From command line, I can see php and phpunit are available (and I've been over my pear install to make sure it's all good):
C:\wamp\www\app\protected\tests>
C:\wamp\www\app\protected\tests>phpunit --version
PHPUnit 3.7.13 by Sebastian Bergmann.
C:\wamp\www\app\protected\tests>
C:\wamp\www\app\protected\tests>php --version
PHP 5.3.5 (cli)
... etc
display_errors is turned on. display_startup_errors is turned on.
I tried renaming the class so that name did not match the document name:
class LittleTestTweak extends CTestCase
I'm not sure of the precise command that runs the test, so I have tried variants like:
php LittleTest.php
Also I've tried running it various places in the folder structure. Here is the immediate structure:
/tests
| bootstrap.php
| my_tree.txt
| phpunit.xml
| WebTestCase.php
|
|---- /fixtures
|---- /functional
| SiteTest.php
|
|---- /report
`---- /unit
LittleTest.php
I also checked my php.ini for the path to PEAR; as far as I can tell, it's correct (but how can I test it?):
include_path=".;C:\wamp\bin\php\php5.3.5\PEAR;C:\wamp\www\app
More Info
In response to this:
cd wamp\www\app\protected\tests
phpunit unit\LittleTest.php
I receive this:
Warning: require_once(PHPUnit/Extensions/SeleniumTestCase.php):
failed to open stream: No such file or directory in
C:\wamp\www\yii\framework\test\CWebTestCase.php on line 12
Call Stack:
0.0007 339624 1. {main}() C:\wamp\bin\php\php5.3.5\phpunit:0
0.0164 698440 2. PHPUnit_TextUI_Command::main()
C:\wamp\bin\php\php5.3.5\phpunit:46
0.0164 698856 3. PHPUnit_TextUI_Command->run()
C:\wamp\bin\php\php5.3.5\PEAR\PHPUnit\TextUI\Command.php:129
0.0164 698856 4. PHPUnit_TextUI_Command->handleArguments()
C:\wamp\bin\php\php5.3.5\PEAR\PHPUnit\TextUI\Command.php:138
0.0289 1220944 5. PHPUnit_TextUI_Command->handleBootstrap()
C:\wamp\bin\php\php5.3.5\PEAR\PHPUnit\TextUI\Command.php:606
0.0300 1233328 6. PHPUnit_Util_Fileloader::checkAndLoad()
C:\wamp\bin\php\php5.3.5\PEAR\PHPUnit\TextUI\Command.php:778
0.0330 1233424 7. PHPUnit_Util_Fileloader::load()
C:\wamp\bin\php\php5.3.5\PEAR\PHPUnit\Util\Fileloader.php:76
0.0334 1238096 8. include_once
('C:\wamp\www\app\protected\tests\bootstrap.php')
C:\wamp\bin\php\php5.3.5\PEAR\PHPUnit\Util\Fileloader.php:92
0.0412 1520256 9. require_once
('C:\wamp\www\app\protected\tests\WebTestCase.php')
C:\wamp\www\app\protected\tests\bootstrap.php:8
0.0413 1520520 10. YiiBase::autoload()
C:\wamp\www\yii\framework\YiiBase.php:0
0.0423 1543904 11.
include('C:\wamp\www\yii\framework\test\CWebTestCase.php')
C:\wamp\www\yii\framework\YiiBase.php:395
Fatal error: require_once(): Failed opening required
'PHPUnit/Extensions/SeleniumTestCase.php'
(include_path='.;C:\wamp\bin\php\php5.3.5\PEAR\pear;C:\wamp\bin\php\php5.3.5\pear')
in C:\wamp\www\yii\framework\test\CWebTestCase.php on line 12
Call Stack:
0.0007 339624 1. {main}() C:\wamp\bin\php\php5.3.5\phpunit:0
0.0164 698440 2. PHPUnit_TextUI_Command::main()
...et cetera...
The failed requirement is PHPUnit/Extensions/SeleniumTestCase.php. I wonder if the issue is that PHPUnit is installed locally under C:\wamp.
I opened my php.ini and added to include_path: C:\wamp\bin\php\php5.3.5\PEAR\PHPUnit\Extensions. Restarted wamp. No change in error reporting.
RESOLUTION
My security setup uses DansGuardian and I had neglected to loosen the settings for banned extension types, which blocks file downloads. In fact I don't care to ban any types, and modifying that file allows everything to work. Woops, that's my Linux set. PHPUnit is working there, and it is working on WAMP also. Recreating the steps on WAMP is impossible; but I do know I had to open cmd.exe as administrator and pear update-channels, pear upgrade-all, etc. I also had to clear pear's cache at one point, and I had to overcome an issue with curl recognition to install Selenium:
pear install --force phpunit/PHPUnit_Selenium
To run unit tests in Yii with phpunit, you'll need to let phpunit load the protected/tests/bootstrap.php file which basically sets up a configuration, and autoloads the required classes (mainly pertaining to testing). The bootstrap.php file loads yiit.php which actually autoloads the required classes.
Now we can load all this configuration either by command line options when running phpunit, or let the configuration be read automatically through the protected/tests/phpunit.xml file.
For the latter method, the directory from where phpunit is invoked should have the phpunit.xml file in it, and in Yii default webapp, this directory is protected/tests. Therefore you need to do the following to run your tests:
cd wamp\www\app\protected\tests
phpunit unit\LittleTest.php

NANO-X Microwindows Embedded Linux

Hello I am new to the coding for the Embedded Linux for ARM platform.
I am using the NANO-X microwindopw for the GUI inteface for the Linux server, so i have downloaded the nano-x soruce from (ftp://microwindows.censoft.com/pub/microwindows/)
then i try to compile the demo code for the nano-x. when i try to compile it gives me the error
: undefined reference to `GrOpen',' GrReqShmCmds'...............
I could not successfully build it.
I have included all the header files from the /microwin/src/include/ to the /usr/include.
still i am getting the error.

Apache Problem, phpinfo gives following arror

Simply calling phpinfo(); gives the following info..
Fatal error: Using $this when not in object context in /var/www/phpinfo.php on line 2
It is a fresh Ubuntu + Apache install on Amazon EC2.
not possible, there has to be something else in the file.
<?php
phpinfo();
?>
You might be using
$this->phpinfo();
Try using simply
phpinfo();
More info here http://php.net/manual/en/function.phpinfo.php

Find out what Version of MT and Mono an App was built with?

Is there a way to tell from the app bundle what version of monotouch and mono was used for a specific app?
Here's one way to do this:
$ pwd
/Users/sebastienpouliot/src/TestCase/bin/iPhone/Debug/TestCase.app
$ cat version.cs
using System;
class Program {
static void Main ()
{
Console.WriteLine (MonoTouch.Constants.Version);
}
}
$ /Developer/MonoTouch/usr/bin/smcs version.cs -r:monotouch.dll
$ MONO_PATH=. mono version.exe
4.2
You can infer the version of Mono from the version of MonoTouch (4.x uses 2.10, 3.x used 2.6). Note that this could fail if the linker eliminated Console.WriteLine.

Getting Hello World in AIR to install

I have an AIR application that is the following:
<h1>Hello World</h1>
It runs on my local machine:
C:\inetpub\wwwroot\AIR\HelloWorldDestination.air
And it runs if I choose "preview in Adobe AIR" in Dreamweaver.
But I can't get it to download and install from my website.
Here is the application.xml that Dreamweaver created:
<?xml version="1.0" encoding="utf-8" ?>
<application xmlns="http://ns.adobe.com/air/application/2.0">
<filename>HelloWorldFileName</filename>
<copyright>Hello World Copyright</copyright>
<description>Hello World Description</description>
<customUpdateUI>false</customUpdateUI>
<name>HelloWorldAppName</name>
<id>com.PhillipSenn.HelloWorldID</id>
<version>1</version>
<initialWindow>
<content>HelloWorld.htm</content>
<height>600</height>
<width>800</width>
<systemChrome>standard</systemChrome>
<transparent>false</transparent>
<visible>true</visible>
</initialWindow>
</application>
It's giving me an error 2032.
I have uploaded these files as well:
AC_RunActiveContent.js
badge.swf
HelloWorldDestination.air
Here's my line of code in Index.htm:
'flashvars','appname=HelloWorldAppName&appurl=http://www.PhillipSenn.com/AIR/HelloWorldDestination.air&airversion=2.0&imageurl=css/Install.gif',
When I create the AIR file, Dreamweaver gives me the following warning:
In order to install this application
on your machine, you need the Adobe
AIR runtime that can be downloaded
from: http://www.adobe.com/go/air
The application to be installed cannot be found at http://www.phillipsenn.com/AIR/HelloWorldDestination.air