PhpStorm - Configuring deployment remote server for debug - phpstorm

I want to debug in a remote server, which is, by the way, a Vagrant machine. Not really a remote server, but this has a peculiar setup: the shared host/vagrant machine folder isn't related to the web server files.
The server is configured with Zend Framework.
I have, locally, to deploy to the machine the following folders (as Zend Framework structure):
/home/user/webStuff/web
Inside web: config, data, module, vendor and public folders
Inside public folder I have the index.php, which handles all server requests.
Following is the server deployment configuration:
When I press "Test SFTP Connection" everything is fine. When I press "Open", the website opens.
And here, is the "Mappings" tab on the deployment configuration
Everything seems OK, here. At least from my point of view.
But when I test the settings, in Run -> WebServer Debug Validation, it gives me "Failed to collect files: Invalid relative file name". I've tried more settings, like placing /web/public in Web path, but with no success.
In Settings -> Languages & Frameworks -> PHP I have a good configuration for the server vagrantmachine.com, with XDebug version correctly displayed.
Also, I've placed the following in xdebug.ini:
xdebug.remote_connect_back = 1
xdebug.remote_enable=1
I've searched and tried a lot, but with no success.
I'm no specialist in these server configuration things, but if you need any information, just ask.

"Deployment path on server" and "Root Path" were wrong.
Like #Eugene Morozov said, I changed the root path to "/opt/webStuff" and deployment path to "/" and it worked out.

Related

Unable to launch MapServer through MS4W

I have installed the MS4W map server and when I try to launch the site in the localhost it takes me to the below landing page. I am unable to see the map getting loaded in the page.
Any suggestions?
Besides using the setup.exe installer from https://ms4w.com, you can install MS4W manually as well, using the .zip available there; you can use the steps below to verify your installation either way:
make sure that you installed/extracted MS4W into a root of a drive (for example,
you should have a resulting directory structure such as:
C:/
ms4w
Apache
apps
...
open a command prompt window (use Windows search, enter "cmd", and make sure to
choose "Run as Administrator"
now in Command Prompt, enter:
cd c:/ms4w
then setup the MS4W environment with:
setenv.bat
which should let you know that the MS4W environment is ready:
GDAL, mapserv, Python, PHP, and commandline MS4W tools path set
now we can install the Apache web server:
apache-install.bat
which should display a successful message such as (notice the text "The Apache MS4W Web Server service was started successfully") :
Installing the 'Apache MS4W Web Server' service
The 'Apache MS4W Web Server' service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.
The Apache MS4W Web Server service is starting.
The Apache MS4W Web Server service was started successfully.
if you have errors, you can check the Apache logs at C:/ms4w/Apache/logs
you can also verify that MapServer is ready at the commandline, with:
mapserv -v
which should display MS4W information such as:
MapServer version 7.6.0-dev (MS4W 4.0.3) OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=SVGCAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=POINT_Z_M SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
TIP: try to now execute other MS4W tools at that same commandline, such as gdalinfo --formats or shp2img etc. (basically you can call any tool now, that lives in C:/ms4w/tools, without ever having to change directory there)
now you are ready to goto your localhost, so open your web browser (Firefox, Chrome, IE) and type: 127.0.0.1 <enter>
you should see the MS4W homepage now in your local browser, with a sample map as well (that is actually a fully configured WMS service served from your local machine, serving Spatialite data), such as: https://ms4w.dev/

Openshift application got error

I was created a PHP 5.4 application with Web load balancer and mysql 5.5 support on openshift free plan. My problem is when I login into my app via SSH delete the index.php file in app-root/runtime/repo folder (Openshift web folder) and create new test.txt file, my application doesnt show test.txt file. It still shows Openshift welcome page when I access my application.Then I delete test.txt file. The app-root/runtime/repo folder is empty. I tried create new file name 'blahblah' in runtime folder and access but still nothing, only 404 page. However, restart the application doesn't resolve the problem! The problem only happend when I add 'Web Load Balancer'. Without load balancer, my PHP app working normaly event I delete index.php file
When you use the "Web Load Balancer", it runs in front of your application and monitors which of your web servers are up and running. You can visit http://app-domain.rhcloud.com/haproxy-status to view the status of your backend servers. If nothing responds at the root context (/) of your application on the web servers, the haproxy thinks it is down and takes it out of rotation. You have to have something (even a blank index.php or index.html) page so that the haproxy will get a status 200, or change the url that is monitored in the haproxy.cfg file on your main gear.

For PyCharm/WebStorm my IDE's local server is not detecting other directories

When I select a html file to open "in browser" in Webstorm it works and it opens under the localhost. The issue I'm having is that this webstorm internal server is not detecting any of the other paths in my project root like images and javascript files.
I should note that this feature has worked before on other projects I started from scratch using "new project." The difference with this project is that I opened a directory as a project.
The built-in webserver serves files from http://localhost:<built-in server port>/<project root>. Forward slashes in URLs tell the browser to resolve them relative to the web server root (localhost:63342 in your case), causing 404 errors.
If you like to change the default web path on built-in web server, you have to re-configure the server by editing your system hosts file accordingly - see http://youtrack.jetbrains.com/issue/WEB-8988#comment=27-577559.

Couchbase Mobile (Sync Gateway) sample TODOlite application doesn't replicate; complains _facebook doesn't exist

My objective: get https://github.com/couchbaselabs/ToDoLite-iOS syncing with a Couchbase Server and sync gateway on localhost rather than the default demo URL.
I run sync gateway like so: bin/sync_gateway -url http://localhost:8091
And then the only thing I changed in the example is:
-#define kSyncGatewayUrl #"http://demo.mobile.couchbase.com/todolite"
+#define kSyncGatewayUrl #"http://localhost:4984/sync_gateway/"
And when I run
Error: Error Domain=CBLHTTP Code=404 "404 not_found" UserInfo=0x7ff11941fb50 {NSURL=http://localhost:4984/sync_gateway/_facebook, NSLocalizedFailureReason=not_found, NSLocalizedDescription=404 not_found}
How do I fix this?
I solved it. The reason is that I ran sync_gateway without enabling Facebook registration support.
Normally this is done in config.json file. In fact, this configuration file was supplied in ToDoLite all along.
It is crucial that you launch sync_gateway with this configuration file. The README actually states this but in a loose and casual way...
cd ToDoLite-iOS
sync_gateway -url http://localhost:8091 sync-gateway-config.json
NB: I assume above that sync_gateway has been made accessible through $PATH. It's a good idea to do that anyway.
Also, I didn't pay attention to the dbname. So you'll need to replace
#define kSyncGatewayUrl #"http://demo.mobile.couchbase.com/todolite"`
with
#define kSyncGatewayUrl #"http://localhost:4984/todos"
So, what's the complete sequence of steps to get it working?:
If you want to wipe everything on the server, rm -rf Library/Application\ Support/Couchbase and start over. Homebrew cask hides this setting somewhere else where it's hard to reset so a manual install is very recommended.
Install Couchbase Server
Set up login credentials if fresh install; otherwise just login
Create a bucket (a database) with name todos on the cluster. This is the dbname used by TODOLite.
Launch sync gateway. Be sure to pass in the replication URL AND the JSON config file.
bin/sync_gateway -url http://localhost:8091 sync-gateway-config.json; keep sync gateway running
In the TODOLite AppDelegate.m, change kSyncGatewayUrl:
#define kSyncGatewayUrl #"http://localhost:4984/todos". Notice the name of the database is necessary!
(Optionally) Access the administrator interface of the sync gateway by going to http://localhost:4985/_admin/db/sync_gateway/sync. You can set up the sync function here.
In case you're wondering where those port numbers came from, check out
ports Couchbase Server uses
ports Sync Gateway uses
4984 — SG API port
4985 — SG admin server
The default remote sync URL will be defined in different files depending on the version of the project you download (iOS, Android, PhoneGap, and Motion). To find the appropriate string to change simply search through your project for the URL "http://demo.mobile.couchbase.com/todolite" and replace it with the URL of your new sync gateway database.

How to install ioncube Loader on openshift

I'm having a problem activating ioncube on openshift.
The loader-wizard tells me to do the following steps:
1) Download one of the following archives of Loaders for Linux x86-64: zip tar.gz tar.bz2 etc.
2)Transfer the Loaders to your web server and install in /usr/lib64/php/modules
3) Put this: "zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_5.3.so " in your ini files directory, /etc/php.d
4)Restart the Apache server software. When the server software has restarted, click here to test the Loader. If the Loader installation failed, check the Apache error log file for errors and see our guide to Unix related errors.
But I can't transfer the loader in /usr/lib64/php/modules, because I don't have permissions.
I tried to put the loader somewhere else and edit the new php ini located at ~/php/versions/shared/configuration/etc/php.ini I added there the the path to the loader, restarted the app, but still does not work.
I also posted this question on openshift.com forums, but didn't get any answers at the moment.
Any suggestions will be very appreciated.
Thank you.
Success in Loader installation will ultimately depend on the server and PHP configuration.
ionCube have recently released a Windows based installer that can automatically deploy the required Loader locally or to a remote server over FTP or SFTP, and also make configuration file changes. I suggest trying that. The download is at http://ioncu.be/LI
(disclosure: I am associated with ionCube)