I am using WAMP. I want to use php from the command prompt. What is the entry in PATH env variable for this ?
Answers
- create a batch file to run your php script using php executable "C:wampphpphp.exe C:wampwwwindex.php"
- add this batch file in Scheduled Task in Windows control panel.
if you mean apply a background color with your header
function you should apply the fill color directly on the $pdf->rect
function in TCPDF
Rect( $x, $y, $w, $h, $style = '', $border_style = array(), $fill_color = array() )
so in your case it would be
$this->Rect(0, 0, $this->getPageWidth(), $this->getPageHeight(), 'DF', "", array(220, 220, 200));
where you have to change the array in the last argument to apply your color
It don't work because on TCPDF the fill color , as far as i know, will apply on the cell
and multicell
function if you specified the fill argument on true
link on rect function TCPDF
foreach ($whatever as $data) {
if($nextpage)
{
$this->Rect(0, 0, $this->getPageWidth(), $this->getPageHeight(),
'DF', "", array(220, 220, 200)); // where the array is the color expected
}
}
but the better option is to define it in the header and use as the example 51 on TCPDF link to the example
public function Header() {
// get the current page break margin
$bMargin = $this->getBreakMargin();
// get current auto-page-break mode
$auto_page_break = $this->AutoPageBreak;
// disable auto-page-break
$this->SetAutoPageBreak(false, 0);
// set bacground image
$img_file = K_PATH_IMAGES.'image_demo.jpg';
$this->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
// restore auto-page-break status
$this->SetAutoPageBreak($auto_page_break, $bMargin);
// set the starting point for the page content
$this->setPageMark();
}
so here it's
public function Header() {
// get the current page break margin
$bMargin = $this->getBreakMargin();
// get current auto-page-break mode
$auto_page_break = $this->AutoPageBreak;
// disable auto-page-break
$this->SetAutoPageBreak(false, 0);
$this->Rect(0, 0, $this->getPageWidth(), $this->getPageHeight(),
'DF', "", array(220, 220, 200)); // where the array is the color expected
$this->SetAutoPageBreak($auto_page_break, $bMargin);
// set the starting point for the page content
$this->setPageMark();
}
This is not possible, and the documentation says so explicitly:
[...] The ability for a package author to determine where a package will be installed either through setting the path directly in their composer.json or through a dynamic package type: "type": "framework-install-here".
It has been proposed many times. Even implemented once early on and then removed. Installers won't do this because it would allow a single package author to wipe out entire folders without the user's consent. That user would then come here to yell at us.
(Emphasis mine)
The two keys you are using (installer-paths
and installer-name
) serve a different purpose than what you imagine:
installer-name
: allows the package author (you) to say your package should be installed under a different directory thanvendor/name
. In your case, instead of being installed onvendor/demo/contentfeed
, it would be installed undervendor/demo/packages
(because of your setting incomposer.json
)installer-paths
: allows the package consumer to set a custom install path for a certain package or packages or package family. On a packagecomposer.json
has no effect, this setting is only for the project configuration.
You don't have to reboot the computer, just restart the apache and the php module will read the new ini.
Did you change the correct php.ini? In case of doubt
<?php echo 'php.ini: ', get_cfg_var('cfg_file_path'); ?>
can tell you.
Is there something in the error.log of the apache that indicates that something went wrong while loading php and the php_curl.dll?
Did you start the apache as a win32 service? If you did try to start it as a console application. Error messages will show up on the console then. Or start it as a service and take a look at the error.log file and the windows event log (start, run, eventvwr.msc /s
).
edit:
"The specified procedure could not be found"
You need a dll that is compatible with your php version and build. Exactly what did you install and where did you get it from?
You need to put the directory that has
php.exe
in youWAMP
installation into yourPATH
. It is usually something likeC:wampxamppphp