I'm creating a website using Symfony2 framework but I can't get proceed to the creation of the website because I don't know where to type like these
$ php symfony configure:database "mysql:host=localhost;dbname=jobeet" root mYsEcret,
$ php symfony doctrine:build-schema.
It seems an Linux command and it doesn't work on windows command-prompt.
What commandLine should I used for this ?
You need to add your PHP installation directory to the %PATH% environment variable, or work from the PHP installation directory.
To add it to path (The best approach - Edited for Windows 7):
Right-click on a My Computer icon
Click Properties
Click Advanced system settings from the left nav
Click Advanced tab
Click Environment Variables button
In the System Variables section, select Path (case-insensitive) and click Edit button
Add a semi-colon (;) to the end of the string, then add the full file system path of your PHP installation (e.g. C:\Program Files\PHP)
Keep clicking OK etc until all dialog boxes have disappeared
Close your command prompt and open it again
Sorted
Alternatively, you can run cd <PHP installation path> before you try and run you command, or call your script like <FULL file system path of php.exe> <path to script>
Then you open the CMD and you write the Symfony commands
I would suggest you to use Easyphp, it has phpreg.exe (or something like that) that will put php in %PATH% variable. It also allows you to create virtual hosts from browser, and easyphp will take care of everything else.
Instead of Sublime, use Phpstorm. It has by far the best Symfony2 plugin of all editors. If you are still learning S2, you will definatelly need autocompletion for forms, services, doctrine... Just amazing!
Related
I want to create a Chocolatey package to install Scene Builder, so I'm looking for a way to install Scene Builder silently in command line.
I downloaded a installer (SceneBuilder-8.4.1.exe) and try to install like below.
> SceneBuilder-8.4.1.exe /silent
However, it launches a install dialog similarly in the case when I double click a installer.
Does Scene Builder installer has a capability to install silently?
You could try to find out what kind of installer is used and look up the silent installation flags or you can try experimentally. The Chocolatey documentation says something like this
https://chocolatey.org/docs/helpers-install-chocolatey-package#silentargs-string
If you pass a "help" parameter to the installer it indicates some silent switches and some documentation.
PS> ./SceneBuilder-9.0.1.exe /?
---------------------------
Setup
---------------------------
The Setup program accepts optional command line parameters.
/HELP, /?
Shows this information.
/SP-
Disables the This will install... Do you wish to continue? prompt at the beginning of Setup.
/SILENT, /VERYSILENT
Instructs Setup to be silent or very silent.
/SUPPRESSMSGBOXES
Instructs Setup to suppress message boxes.
/LOG
Causes Setup to create a log file in the user's TEMP directory.
/LOG="filename"
Same as /LOG, except it allows you to specify a fixed path/filename to use for the log file.
/NOCANCEL
Prevents the user from cancelling during the installation process.
/NORESTART
Prevents Setup from restarting the system following a successful installation, or after a Preparing to Install failure that requests a restart.
/RESTARTEXITCODE=exit code
Specifies a custom exit code that Setup is to return when the system needs to be restarted.
/CLOSEAPPLICATIONS
Instructs Setup to close applications using files that need to be updated.
/NOCLOSEAPPLICATIONS
Prevents Setup from closing applications using files that need to be updated.
/RESTARTAPPLICATIONS
Instructs Setup to restart applications.
/NORESTARTAPPLICATIONS
Prevents Setup from restarting applications.
/LOADINF="filename"
Instructs Setup to load the settings from the specified file after having checked the command line.
/SAVEINF="filename"
Instructs Setup to save installation settings to the specified file.
/LANG=language
Specifies the internal name of the language to use.
/DIR="x:\dirname"
Overrides the default directory name.
/GROUP="folder name"
Overrides the default folder name.
/NOICONS
Instructs Setup to initially check the Don't create a Start Menu folder check box.
/TYPE=type name
Overrides the default setup type.
/COMPONENTS="comma separated list of component names"
Overrides the default component settings.
/TASKS="comma separated list of task names"
Specifies a list of tasks that should be initially selected.
/MERGETASKS="comma separated list of task names"
Like the /TASKS parameter, except the specified tasks will be merged with the set of tasks that would have otherwise been selected by default.
/PASSWORD=password
Specifies the password to use.
For more detailed information, please visit http://www.jrsoftware.org/ishelp/index.php?topic=setupcmdline
---------------------------
OK
---------------------------
http://www.jrsoftware.org/ishelp/index.php?topic=setupcmdline
The Universal Silent Switch Finder says this is an Inno Setup installer and suggests some switches.
I am trying to start a project using Symfony on a Mac Sierra.
I installed Symfony successfully, but I get this warning:
We selected the timezone 'UTC' for now, but please set date.timezone
to select your timezone. in
phar:///usr/local/bin/symfony/src/Symfony/Installer/NewCommand.php on
line 283 ✕ Symfony 3.2.1 was successfully installed but your system
doesn't meet its
technical requirements! Fix the following issues before executing
your Symfony application: * date.timezone setting must be set
> Set the "date.timezone" setting in php.ini* (like Europe/Paris).
I tried to change php.ini with brackets editor on the created project on folders:
project/vendor/doctrine/cache/test/travis/php.ini
project/vendor/doctrine/doctrine-cache-bundle/test/travis/php.ini
Didn't help.
As I read Symfony has built-in Apache Server.
Those php.ini files are totally unrelated to what you have to do.
Open up the Terminal and type php -i | grep "php.ini". That should reveal the location of the php.ini which is used by PHP in console mode.
XAMPP is known for using different php.ini file for the server. In order to find the the one used by the XAMPP, run a sample php file with phpinfo() from browser.
Also, note that Symonfy itself does not have the built-in server. In merely used the one PHP provided from version 5.4 and on.
Hope this helps...
I am Mac user, so , in Finder you need to go to /private/etc, find php.ini.default,
Yo need to copy that file to the desktop. To edit you need to unlock the document. Just click Unlock if asked. Rename to php.ini, set the date.timezone=Europe/YourCountry and do not forget to erase the semicolon before.And finally save it and put it back to etc.
Watch: https://www.youtube.com/watch?v=Wb6Fh-B3W-o
I have a rmarkdown document that I render regularly with rmarkdown::render
It works fine on my computer (Windows) as I have RStudio installed, and it has setup automatically the path to pandoc.
However when I try to run it on my server (outside RStudio), it fails with error that pandoc is not found.
How can I set up manually the path the pandoc from my script? Without changing the configuration on the server.
I have tried this but it doesn't work:
Sys.setenv(RSTUDIO_PANDOC="PATH_TO_MY_PANDOC_BIN/binaries/pandoc/pandoc.exe")
I suggest to set the system path for pandoc (Windows 10 instructions):
1. In the Start menu, search for "Edit the system environment variables"
2. At this point, Windows may ask you for username + password (for a user with permission to change system settings)
3. Click "Environment Variables" button
4. In the lower part of the window (System variables), select the line with "Path" and click Edit
5. Add the path to the folder where pandoc.exe is, but not including "pandoc.exe" or a slash at the end
Sys.setenv(RSTUDIO_PANDOC="PATH_TO_MY_PANDOC_BIN/binaries/pandoc/pandoc.exe")
That is actually almost correct, just omit the *.exe files, write the path only up to folder contain pandoc.exe
like this :
Sys.setenv(RSTUDIO_PANDOC="PATH_TO_MY_PANDOC_BIN/binaries/pandoc")
i believe this doesn't require admin rights
I am trying to get ZSH config working correctly on Mac OSX. I installed it using curl: curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh. Then I modified my zshrc file to fit my needs. It works only after I run source ~/.zshrc. But then if I come back and open a new tab or new terminal I have to do source ~/.zshrc to get the config settings to work again. Has anybody ran into this issue? I believe there is a way to make it so I don't have to do source ~/.zshrc with every new tab.
I figured this out. It was due to my config file. The part of the zsh config that wasn't loading needed to be moved down after the plugins load. After moving that it all worked as expected.
If you have themes like Powerlevel9k installed for your zsh shell then source the oh-my-zsh config file after the theme variable assignments in your .zshrc file like shown below.
Eg:
........
........
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=('status' 'load' 'ram_joined' 'time')
# source oh-my-zsh config
source $ZSH/oh-my-zsh.sh
Not the ideal solution but solves the issue:
Terminal -> Preferences -> Profiles -> Shells -> Startup
Check the box that says "Run command" and in the input box run
source ~/.zsh/.zshrc
This will be executed when you open a new terminal window / tab.
My final solution was to go to Terminal --> Preferences --> General --> Shells open with --> Command (complete path), and set it to /bin/zsh (or your path to zsh), and then set both New windows/tabs open with to "Same profile". It works fine for me.
My initial attempt was to go to Terminal --> Preferences --> Profiles, and in my default profile's "shell" tab's Startup section, I set it to run command "source ~/.zshrc". This also solved the problem of /.zshrc not loading, but it seemed tedious to see that command show on every terminal tab/window.
I had a similar problem. I found that I had long ago changed my Terminal preferences to run tcsh instead of the default login shell. Took me forever to figure this out!
I am trying to start use Symfony2, and i have troubles with a first step.
In the documentation I found
To create a bundle called AcmeHelloBundle (a play bundle that you'll
build in this chapter), run the following command and follow the
on-screen instructions (use all of the default options):
php app/console generate:bundle --namespace=Acme/HelloBundle
> --format=yml
and I really don’t understand where should I write this string? In which program or in which file?
As Molecule Man said, it's a command line thing. But just to give a few more details:
Open up a console window (also called a command prompt in Windows)
Type "php --version" (no quotes). It should come back with a version number. If it says something like "can't find php" then you need to set a path to php.
Change directory to your Symfony directory
Type "php app/console" If everything is working then you will see a list of available commands. There are many things you can do from the command line.
If you happen to be on a unix system then you can make console executable and just use "./app/console"
Now try creating your bundle