local and remote zend server - zend-framework2

I'm learning Zend framework 2 therefore i downloaded the zendstudio IDE included with the zend server as well. I made my little application which is working totally fine on my local zend server. I wanted to try zend PHP cloud as well so i deployed my application there with zend studio. This application didn't work perfectly there. Some of the content is working and the other parts did not load at all only white screen. I checked the server logs and this is what i found there:
Function Name Zend\Loader\StandardAutoloader::loadClass
Error Type E_COMPILE_ERROR
Source File /home/container_name/.apps/http/__default__/0/app/1.0.0/vendor/zendframework/zendframework/library/Zend/Loader/StandardAutoloader.php
Error String Can't use method return value in write context
I thought that there might be an error during file uploading so i re uploaded the files via an ftp client and the problem is still exists.
Any help is greatly appreciated

After a couple of hours of code trace i found the solution:
if($this->request->isPost()){
if(!empty($this->getRequest()->getPost('sg')) <--- this is the line where it dies
Remote wasn't liked the !empty() so i replaced it with !=''

Related

How to use swagger file locally?

Hi I have a swagger file written for my API and I could not test the paths of my API since I am getting: ERROR Server not found or an error occurred because my paths are all localhost, so how can i use swagger locally? thank you
I found a solution which is using the building from source way in swagger-editor
Assuming you are developing within Visual studio click the green play looking button to build & run your solution , a browser should now pop up. ignore whatever it comes up with and type localhost/swagger and it should provide you with the interface. Let me know what happens or if you require any assistance

404 error when accessing Struts2 Web application

I had created a web application and committed the code in CVS. The web application is working good in my machine. When i tried to import the same code in another machine i am getting 404 error. I tried importing the code via ftp from my machine to another machine and also checking out the code from CVS. But still i get 404 error.
I also noticed that there is no error that had been captured in the console or in the application's log. Could someone help me in how to proceed further in identifying the issue. Please let me know if i need to post any further details regarding the issue.
I notice this issue to be in the Websphere server. I tried hosting the application in different machine and found that in few machine the same code is working good and some it is not. Is there any way to compare the server configuration?
In the WAS server 6.1 i added the below value in the web container and the application worked fine.
Steps:
In the server admin console, click on Application Server--> --> Web container--> custom properties.
Add the name as com.ibm.ws.webcontainer.invokefilterscompatibility and value as true.
Thank you all for the response.

VS2013 process cannot access the file because it is being used by anther process

I have VS2013 with UPDATE 2 RC installed.
I just created a new MVC project. Compiled and Run has no problem.
I did a small change on the Home/Index.cshtml view. click save and getting message as
"The process cannot access the file
'C:\Temp\TestMVC\TestMVC\Views\Home\xwfz25mf.3dn~' because it is being
used by another process."
. I really don't understand it. I am trying to save the file index.cshtml, not 'xwfz25mf.3dn~' file. I keep consistently getting similar errors when saving other pages.
before installing the "UPDATE 2 RC", vs2013 worked just fined. no problem with saving files at that time.
Can someone please help and let me what's in the "UPDATE 2 RC" which doesn't allow me to save any files at all!. Thanks.!
I had the same problem with my VS2013 ASP.NET MVC project.
At the end I found that the problem was Skype using port 80.
Closing (quit) Skype it worked!

ZF2 Fatal error: Class 'Locale' not found in /home/...../Zend/I18n/Translator/Translator.php on line 228

I have a project in my localhost, already running, after modifying the php.ini of my XAMPP server [running on Windows 7] (adding: extension=php-intl.dll).
But when i upload this project to my GoDaddy hosting, it doesn´t works and get the following error:
Fatal error: Class 'Locale' not found in /home/content/41/9674641/html/library/zend.2.0.4/Zend/I18n/Translator/Translator.php on line 228
GoDaddy hosting details:
Php version 5.3
Operating system: Linux
i386-redhat-linux-gnu
Zend Framework details:
Zend Library: 2.0.4
I´ve tried what they say on the following links:
http://support.godaddy.com/help/article/1085/can-i-add-a-php-initialization-file-to-my-hosting-account?locale=en
http://support.godaddy.com/help/article/5647/why-isnt-my-phpini-file-taking-effect?locale=en&ci=46061
Also, i´ve called to 24/7 goDaddy support and they suggested me to create a php5.ini file in the root directory, then, they told me to stop all web services (Cpanel/Stats & Monitors/System Processes/end web), but they didn´t told me what do i need to include in the php5.ini file.
I was reading some links and, as my localhost is a windows one, adding the extension=php-intl.dll to the php.ini file worked. So i´ve tried to include in my godaddy linux server: extension=php-intl.so but doesn´t works (neither extension=php-intl.dll).
The problem with the goDaddy hosting began when i started using ZF2 FORMs.
Updates:
1) I´ve got access to the php5.ini of the goDaddy server (i have made a copy on the root of my hosting) using PUTTY: cp /web/conf/php5.ini /var/chroot/home/content/41/9674641/html
Then i have read it and i could not find the "intl" extension, instead of this, i only could find:
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
;extension=php_mbstring.dll
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
;extension=php_mysql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
2) goDaddy response to my formal support request (ticket):
Thank you for contacting Online Support
I understand you are wanting to get Internationalization extension on
to your hosting account. At this time these are not supported in our
systems at this time. We are going to review this with our developers
to more information. You may receive an email us down the road with
addition information about this.
Please let us know if we can assist you in any other way.
Now i'm thinking that i have two problems:
A) Include the line to enable the extension (i don't know how):
Maybe could be:
extension_dir=/var/chroot/home/content/41/9674641/html/library/extensions/php-intl/usr/lib64/php/modules
extension="intl.so"
B) Include the extension in some location inside my hosting (but i don´t know how):
Maybe i could put the extension files inside: /var/chroot/home/content/41/9674641/html/library/extensions/php-intl
Also, i don't know where to acquire the extension files
C) Is there any known update on ZF2 (skeleton, library ..) that solve this issue ?
Please, i need help as soon as possible.
You can manage PHP modules by using the "Change PHP version" feature of the cPanel interface. Select any version other than "native" and a list of checkboxes will appear.
http://support.godaddy.com/help/article/3937/viewing-or-changing-your-php-language-version?pc_split_value=2
Of course, their support might not immediately mention this solution, which should have been in their knowledge base in the first place.

Local paths active and causing error to web app. after publish

We're trying to publish our little web app here.
I've done it several times in the past and it worked pretty well.
As the tags states, its a MVC ASP.Net project coded with VS2008.
Other interns worked on that project and we tried to re-publish again and we have this error:
[IndexOutOfRangeException: Index was outside the bounds of the array.]
XXXXXXX.XXXXXXXRepository..ctor() in
E:\XXXXXX\YYYYYYY\ZZZZZZ\XXXXXXXRepository.vb:11
XXXXXXX.HomeController..ctor() in
E:\XXXXXXX\YYYYYY\ZZZZZZ\Controllers\HomeController.vb:10
Problem is, the path pointed here E:\XXXXXXX....*Controller or *Rep is located on the LOCAL machine where the dev. is made. It's as if something was hardcoded directly in our local machines in the Rep.VB and HomeController.VB. It should point in the path where we published the whole project wich is not E:\XXX\YYY\ZZZ
Anyone ever encountered this ?
Thanks alot guys
Have a nice day.
-Tom
That is just information about where to search error in source files, so those paths have nothing to do with error appearance, they just for debugging purposes - if you will compile from your machine, they will change, but error will not dissapear.
Error message indicates, that problem is, that code tries to access array element, which is not there (let's say array has 1 element and program tries to access second one).

Resources