junichi11 / cakephp-netbeans

CakePHP support in NetBeans
http://cakephp.org
71 stars 18 forks source link

CakePhp Run not working #140

Closed sandeshgb closed 6 years ago

sandeshgb commented 6 years ago

I'm using ubuntu 16.04, have installed following: Netbeans: 8.1 Have set path to /usr/bin/php in tools->options->php also have added plugin for cakephp but when I right-click on my project folder and select cakephp->run command, its says <there is no command available (perhaps error?)>

Kindly assist

junichi11 commented 6 years ago

Where is your app/Console directory?(Does app/Console/cake file exist?) Can you write your directory structure?

sandeshgb commented 6 years ago

my-project

junichi11 commented 6 years ago

Thanks. Can you run cake command in your terminal?

junichi11 commented 6 years ago

Your cake version is 2.x, right?

sandeshgb commented 6 years ago

yes I'm using 2.x

sandeshgb commented 6 years ago

I cant run cake from my terminal: Output: eiosys@eiosys:~$ cake The program 'cake' is currently not installed. You can install it by typing: sudo apt install cakephp-scripts eiosys@eiosys:~$

I need to bake using netbeans itself

junichi11 commented 6 years ago
$ cd app
$ sh Console/cake
sandeshgb commented 6 years ago

the above commands provide me available shells and current paths of my app...didnt get it? Cant I do Cakephp->run command in netbeans?

junichi11 commented 6 years ago

Umm, I try to create a new project. So, can you provide your steps to create it?

e.g.

  1. git clone ...
  2. ...
  3. ....
sandeshgb commented 6 years ago

I had cloned the project from git....thats it. You could even have a test-app ex:cakephp blog or default cakephp structure when we create a new cakephp project.

In windows its working, seems to be an issue when switched to ubuntu

junichi11 commented 6 years ago

OK. I'll try it once. Please wait a little while.

sandeshgb commented 6 years ago

@junichi11 really appreciate your effort mate, but I'm available only for next 20 mins. Will continue tomorrow if required.

junichi11 commented 6 years ago

I've just done the following:

  1. git clone -b 2.x git://github.com/cakephp/cakephp.git
  2. Enable this plugin
  3. CakePHP > Run Command

Unfortunately, I cannot reproduce it.

nb-cake-issue140

Can you look at IDE log (View > IDE log)? If you can find something for this plugin, please let me know.

Thanks.

sandeshgb commented 6 years ago

Log says: CONFIG [null]: Parse error in file file:/tmp/nb-cake-commands-6401486998826258495.xml line 1 column 1 (PUBLIC null) [Fatal Error] nb-cake-commands-885150021411211846.xml:1:1: Content is not allowed in prolog. INFO [org.cakephp.netbeans.commands.CakeScript] org.xml.sax.SAXParseException; systemId: file:/tmp/nb-cake-commands-885150021411211846.xml; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:205) at org.cakephp.netbeans.commands.CakePhpCommandXmlParser.parse(CakePhpCommandXmlParser.java:75) [catch] at org.cakephp.netbeans.commands.CakeScript.getFrameworkCommandsInternalXml(CakeScript.java:394) at org.cakephp.netbeans.commands.CakeScript.getCommands(CakeScript.java:244) at org.cakephp.netbeans.commands.CakePhpCommandSupport.getFrameworkCommandsInternal(CakePhpCommandSupport.java:99) at org.netbeans.modules.php.spi.framework.commands.FrameworkCommandSupport.refreshFrameworkCommands(FrameworkCommandSupport.java:150) at org.netbeans.modules.php.spi.framework.commands.FrameworkCommandSupport$1.run(FrameworkCommandSupport.java:181) at org.openide.util.RequestProcessor$Task.run(Unknown Source) at org.netbeans.modules.openide.util.GlobalLookup.execute(Unknown Source) at org.openide.util.lookup.Lookups.executeWith(Unknown Source) at org.openide.util.RequestProcessor$Processor.run(Unknown Source)

junichi11 commented 6 years ago

Thanks! The cause is it.

Your file encoding may not be UTF-8. So please try to check it tomorrow.

Then, please try to run the following command in your terminal:

$ sh Console/cake command_list --xml

Just copy & paste it here.

my result:

app$ sh Console/cake command_list --xml
<?xml version="1.0"?>
<shells><shell name="acl" call_as="acl" provider="CORE" help="acl -h"/><shell name="api" call_as="api" provider="CORE" help="api -h"/><shell name="bake" call_as="bake" provider="CORE" help="bake -h"/><shell name="command_list" call_as="command_list" provider="CORE" help="command_list -h"/><shell name="completion" call_as="completion" provider="CORE" help="completion -h"/><shell name="console" call_as="console" provider="CORE" help="console -h"/><shell name="i18n" call_as="i18n" provider="CORE" help="i18n -h"/><shell name="schema" call_as="schema" provider="CORE" help="schema -h"/><shell name="server" call_as="server" provider="CORE" help="server -h"/><shell name="test" call_as="test" provider="CORE" help="test -h"/><shell name="testsuite" call_as="testsuite" provider="CORE" help="testsuite -h"/><shell name="upgrade" call_as="upgrade" provider="CORE" help="upgrade -h"/></shells>
sandeshgb commented 6 years ago

NetBeans details: Product Version: NetBeans IDE 8.1 (Build 20151231-debian-8.1) Updates: NetBeans IDE is updated to version NetBeans 8.1 Patch 1 Java: 1.8.0_131; OpenJDK 64-Bit Server VM 25.131-b11 Runtime: OpenJDK Runtime Environment 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11 System: Linux version 4.4.0-93-generic running on amd64; UTF-8; en_IN (nb) User directory: /home/eiosys/.netbeans/8.1 Cache directory: /home/eiosys/.cache/netbeans/8.1

Output of app$ sh Console/cake command_list --xml <?xml version="1.0"?>

image

junichi11 commented 6 years ago

Ahh, I see now! There is a warning message before XML. It is the cause. Probably, you did not set the permission to your app/tmp directory correctly.

So try to check the permission.

sandeshgb commented 6 years ago

Ok, I will check the permissions and revert to you

sandeshgb commented 6 years ago

Giving permissions did solve the issue.........thanks!!

junichi11 commented 6 years ago

You're welcome :)