从PHP触发python脚本时,Pi Camera无法正常工作

时间:2019-11-25 09:26:20

标签: php python raspberry-pi3

当从IDLE和控制台执行时它可以工作,但是当我从PHP触发python脚本时,PiCamera将无法工作。

https://www.microsoft.com/cms/api/am/binary/RWiaTt
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>GraysOnline</ShortName>
<Description>Find a great deal with GraysOnline</Description>
<Url type="text/html" template="http://www.graysonline.com/Search.aspx?q={searchTerms}" />
<Url type="application/x-suggestions+xml" template="http://www.graysonline.com/OpenSearch/SuggestionsXml.aspx?q={searchTerms}" />
<Url type="application/rss+xml" template="http://www.graysonline.com/OpenSearch/SuggestionsRss.ashx?q={searchTerms}" />
<Image height="16" width="16" type="image/icon">http://images.graysonline.com/favicon.ico</Image>
</OpenSearchDescription>

https://www.microsoft.com/cms/api/am/binary/RWidzo
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>The-Arena</ShortName>
<Description>The-Arena</Description>
<InputEncoding>UTF-8</InputEncoding><Image height="16" width="16" type="image/x-icon">http://www.the-arena.co.uk/favicon.ico</Image>
<Url type="text/html" method="get" template="http://www.the-arena.co.uk/default.aspx?sc={searchTerms}" />
<Url type="application/rss+xml" method="get" template="http://www.the-arena.co.uk/arena_rss.aspx?sc={searchTerms}" />
<Url type="application/x-suggestions+xml" template="http://www.the-arena.co.uk/autosuggestion.aspx?sc={searchTerms}" />
<Url type="application/x-suggestions+json" template="http://www.the-arena.co.uk/autosuggestionjson.aspx?sc={searchTerms}" />
</OpenSearchDescription>

https://www.microsoft.com/cms/api/am/binary/RWihZ8
<OpenSearchDescription xmlns:moz="http://www.mozilla.org/2006/browser/search/" xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Wikipedia (en)</ShortName>
<Description>Wikipedia (en)</Description><Image height="16" width="16" type="image/x-icon">http://en.wikipedia.org/favicon.ico</Image>
<Url type="text/html" method="get" template="http://en.wikipedia.org/w/index.php?title=Special:Search&amp;search={searchTerms}" />
<Url type="application/x-suggestions+json" method="get" template="http://en.wikipedia.org/w/api.php?action=opensearch&amp;search={searchTerms}&amp;namespace=0" />
<Url type="application/x-suggestions+xml" method="get" template="http://en.wikipedia.org/w/api.php?action=opensearch&amp;format=xml&amp;search={searchTerms}&amp;namespace=0" /><moz:SearchForm>http://en.wikipedia.org/wiki/Special:Search</moz:SearchForm>
</OpenSearchDescription>

https://www.microsoft.com/cms/api/am/binary/RWilsN
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Yahoo!</ShortName>
<Url type="text/html" template="https://search.yahoo.com/search?p={searchTerms}&amp;b={startPage?}&amp;fr=ie8" />
<Url type="application/x-suggestions+xml" template="https://ie.search.yahoo.com/os?appid=ie8&amp;command={searchTerms}" /><Image height="16" width="16" type="image/icon">http://search.yahoo.com/favicon.ico</Image>
</OpenSearchDescription>

https://www.microsoft.com/cms/api/am/binary/RWilsP
<OpenSearchDescription xmlns:ie="http://schemas.microsoft.com/Search/2008/" xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Bing</ShortName><Tags>Bing</Tags>
<Description>Bing Search by Microsoft.</Description><Contact>msosa@microsoft.com</Contact>
<InputEncoding>UTF-8</InputEncoding><SyndicationRight>limited</SyndicationRight><Image type="image/x-icon" height="16" width="16">http://www.bing.com/favicon.ico</Image>
<Url type="text/html" template="http://www.bing.com/search?q={searchTerms}&amp;amp;src=IE-SearchBox&amp;amp;FORM=IESR02" />
<Url type="application/x-suggestions+xml" template="http://api.bing.com/qsml.aspx?query={searchTerms}&amp;maxwidth={ie:maxWidth}&amp;rowheight={ie:rowHeight}&amp;sectionHeight={ie:sectionHeight}&amp;FORM=IESS02&amp;market={language}" /><ie:TopResult type="text/html" template="http://www.bing.com/search?q={searchTerms}&amp;src=IE-TopResult&amp;FORM=IETR02" /><ie:NTSearchResult type="text/html" template="http://www.bing.com/search?q={searchTerms}&amp;src=IE-SearchBox&amp;FORM=IENTSR" /><ie:NTTopResult type="text/html" template="http://www.bing.com/search?q={searchTerms}&amp;src=IE-SearchBox&amp;FORM=IENTTR" /><ie:NTSearchSuggestion type="application/x-suggestions+xml" template="http://api.bing.com/qsml.aspx?query={searchTerms}&amp;market={language}&amp;maxwidth={ie:maxWidth}&amp;rowheight={ie:rowHeight}&amp;sectionHeight={ie:sectionHeight}&amp;FORM=IENTSS" /><ie:NTLogo type="image/png">http://go.microsoft.com/fwlink/?LinkID=403856&amp;language={language}&amp;scale={scalelevel}&amp;contrast={contrast}</ie:NTLogo>
</OpenSearchDescription>

https://www.microsoft.com/cms/api/am/binary/RWihZ7
<OpenSearchDescription xmlns:ie="http://schemas.microsoft.com/Search/2008/" xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>eBay</ShortName>
<Description>eBay - The World's Online Marketplace</Description><Image height="16" width="16" type="image/x-icon">http://ie8.ebay.com/resources/images/favicon.ico</Image>
<Url type="text/html" method="get" template="http://rover.ebay.com/rover/1/711-43047-14818-1/4?satitle={searchTerms}" />
<Url type="application/x-suggestions+json" method="get" template="http://sug.ebay.com/?q={searchTerms}&amp;c=0" />
<Url type="application/x-suggestions+xml" method="get" template="http://ie8.ebay.com/suggest/visual/?q={searchTerms}&amp;s=0" /><ie:PreviewUrl type="text/html" template="http://ie8.ebay.com/accelerator/search/?q={searchTerms}&amp;s=0" />
</OpenSearchDescription>

https://www.microsoft.com/cms/api/am/binary/RWiaTu
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Youtube</ShortName>
<Url type="text/html" template="http://www.youtube.com/results?search_query={searchTerms}" /><Image height="16" width="16" type="image/icon">http://s.ytimg.com/yt/favicon-vfl1123.ico</Image>
</OpenSearchDescription>

https://www.microsoft.com/cms/api/am/binary/RWilsM
<OpenSearchDescription xmlns:ie="http://schemas.microsoft.com/Search/2008/" xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Google</ShortName>
<Description>Google Search</Description>
<Url xmlns:referrer="http://a9.com/-/opensearch/extensions/referrer/1.0/" type="text/html" template="https://www.google.com/search?q={searchTerms}&amp;sourceid=ie7&amp;rls=com.microsoft:{language}:{referrer:source}&amp;ie={inputEncoding?}&amp;oe={outputEncoding?}" />
<Url rel="suggestions" type="application/x-suggestions+xml" template="https://www.google.com/complete/search?q={searchTerms}&amp;client=ie8&amp;mw={ie:maxWidth}&amp;sh={ie:sectionHeight}&amp;rh={ie:rowHeight}&amp;inputencoding={inputEncoding}&amp;outputencoding={outputEncoding}" /><Image height="16" width="16" type="image/icon">https://www.google.com/favicon.ico</Image></OpenSearchDescription>
import picamera from PiCamera
from time import sleep

camera = PiCamera()
camera.start_preview()
camera.capture('/home/pi/Pictures/image.JPEG')
camera.stop_preview()
camera.close()

0 个答案:

没有答案